Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
juerg committed Jan 15, 2024
1 parent cb58a44 commit f5c5e2b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main/resources/com/github/jlangch/venice/venice.venice
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
(defonce java-11-home (str/strip-end (system-env :JAVA_11_HOME) "/"))
(defonce java-home java-8-home)

(defonce sonatype-user "xxxxxx")
(defonce sonatype-user "jlangch")

(defonce cmd-line-prompt (str proj-name "> "))

Expand All @@ -67,6 +67,8 @@
;; "--debug"
"-Dorg.gradle.java.home=\"~{java-home}\""])

(defonce display-status? false)



;; -----------------------------------------------------------------------------
Expand Down Expand Up @@ -217,9 +219,20 @@
Build Java 8: ~{java-8-home}
Build Java 11: ~{java-11-home}
Color theme: ~(color-theme)
Terminal: [~(repl/term-cols) x ~(repl/term-rows)]

"""))


(defn display-status []
(when display-status?
(let [cols (repl/term-cols)
left (str/format "%s" (java-version))
right ""
delim (str/repeat "-" (- cols 8 (count left) (count right)))]
(status (str/format "-- %s %s %s --" left delim right)))))


(defn run-command [cmd & args]
(cond
(nil? cmd) nil
Expand Down Expand Up @@ -257,6 +270,7 @@
(defn handle-command [cmd]
(try
(apply run-command (split-command cmd))
(display-status)
(catch :EofException ex
(error "Terminating shell...")
(sleep 1000)
Expand Down Expand Up @@ -284,3 +298,4 @@
(. *REPL* :setHandler (proxify :Consumer { :accept handle-command }))

(display-welcome-msg)
(display-status)

0 comments on commit f5c5e2b

Please sign in to comment.