Big project dir refactor

* split into multi member workspace in preparation for a no_std core
* env and posix stuff neatly crammed into a seperate shell project
* some pokes at interactive-devel.f
* updated ci
* removed 'l' shortcut for 'load' and update docs
* remove out of date readme content
* updated tests
* more sensible cond implementation and extra tests
* substr stdlib function with tests

Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2024-07-10 13:22:28 -07:00
parent aa56570d7d
commit 6d2925984f
44 changed files with 967 additions and 779 deletions

View file

@ -21,9 +21,9 @@
;; username, and percentages for all batteries on the system.
;; -> requires CFG_FLESH_POSIX=true and userlib.
(def _batteries 'paths to batteries powering system'
(def _batteries "paths to batteries powering system"
(lambda ()
(let ((power-srcs-dir '/sys/class/power_supply')
(let ((power-srcs-dir "/sys/class/power_supply")
(power-srcs
(split (load-to-string find /sys/class/power_supply -printf "%p ")
" "))
@ -39,7 +39,7 @@
(set (q pwr-iter) (pop rem))))
pwr-list)))
(def display-batteries 'display battery capacity'
(def display-batteries "display battery capacity"
(lambda ()
(let ((bat-iter (pop (_batteries)))
(display ""))
@ -53,14 +53,14 @@
(set (q bat-iter) (pop rem))))
display)))
(def CFG_FLESH_R_PROMPT 'display battery info'
(def CFG_FLESH_R_PROMPT "display battery info"
()
(display-batteries))
(def _fancy-cwd 'prints (up to) last three segments of current path'
(def _fancy-cwd "prints (up to) last three segments of current path"
()
(let ((cdir (load-to-string pwd))
(dir-segs (split cdir '/'))
(dir-segs (split cdir "/"))
(dir-iter (dq dir-segs))
(i 0))
(if (lte? (len dir-segs) 4)
@ -73,14 +73,14 @@
(concat "..." final)))))
(def in-a-git-repo?
'returns true or false depending on if currently in a git repo'
"returns true or false depending on if currently in a git repo"
() (eq? (load-to-string git rev-parse --is-inside-work-tree) "true"))
(def git-repo-is-dirty?
'returns true or false depending on if current dir is a dirty git repo'
() (not (eq? (load-to-string git diff '--stat') "")))
"returns true or false depending on if current dir is a dirty git repo"
() (not (eq? (load-to-string git diff "--stat") "")))
(def git-status 'returns "(git:<branch>{!,})" if dir is in a git repository'
(def git-status "returns '(git:<branch>{!,})' if dir is in a git repository"
()
(if (in-a-git-repo?)
(concat
@ -90,9 +90,9 @@
"!"
"")
")")
''))
""))
(def CFG_FLESH_L_PROMPT 'display user and dir (git info in future)'
(def CFG_FLESH_L_PROMPT "display user and dir (git info in future)"
()
(concat
"[" USER "]" "\t"