Use (env "HOME") in pebblisp.pbl for reload.

Show current working directory in prompt.
This commit is contained in:
Sage Vaillancourt 2022-03-30 16:59:01 -04:00 committed by Sage Vaillancourt
parent b5f6a7d951
commit b4e0f57029
1 changed files with 5 additions and 3 deletions

View File

@ -12,13 +12,15 @@
(def nl (ch 10)) (def nl (ch 10))
(def reload (fn () (loadfile "/home/sagevaillancourt/.pebblisp.pbl"))) (def reload (fn () (loadfile (cat (env "HOME") "/.pebblisp.pbl"))))
(def hour (fn (ti) ( (def hour (fn (ti) (
(def h (% ti's hour 12)) (def h (% ti's hour 12))
(if (= 0 h) 12 h) (if (= 0 h) 12 h)
))) )))
(def pwd (fn () (env "PWD")))
(def zero (fn (num) (cat (if (< num 10) "0" "") num))) (def zero (fn (num) (cat (if (< num 10) "0" "") num)))
(def clock (fn (ti) (cat (hour ti) ":" (zero ti's minute) ":" (zero ti's sec)))) (def clock (fn (ti) (cat (hour ti) ":" (zero ti's minute) ":" (zero ti's sec))))
@ -27,6 +29,6 @@
(def ti (time)) (def ti (time))
(cat nl (cat nl
bold red "[sage] " blue (clock) nl bold red "[sage] " blue (clock) " " reset cyan (pwd) nl
green "pebblisp ~> " reset) bold green "pebblisp ~> " reset)
))) )))