From b4e0f57029f470e5c9bf1a89e73a444be3e452c6 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 30 Mar 2022 16:59:01 -0400 Subject: [PATCH] Use (env "HOME") in pebblisp.pbl for reload. Show current working directory in prompt. --- src/examples/pebblisp.pbl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/examples/pebblisp.pbl b/src/examples/pebblisp.pbl index e5434bc..c0cf16f 100644 --- a/src/examples/pebblisp.pbl +++ b/src/examples/pebblisp.pbl @@ -12,13 +12,15 @@ (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 h (% ti's hour 12)) (if (= 0 h) 12 h) ))) +(def pwd (fn () (env "PWD"))) + (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)))) @@ -27,6 +29,6 @@ (def ti (time)) (cat nl - bold red "[sage] " blue (clock) nl - green "pebblisp ~> " reset) + bold red "[sage] " blue (clock) " " reset cyan (pwd) nl + bold green "pebblisp ~> " reset) )))