1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-09 10:19:54 +00:00

Add shorthand for installing scripts via bundle/add-bin.

Establishing a convention for scripts is beneficial for various tools.
However, we do not install scripts on anyones PATH - instead they go
to a self contained (dyn *syspath*) /bin folder which could be added to
path, or symlinks could be added.
This commit is contained in:
Calvin Rose 2024-07-12 11:11:43 -05:00
parent 31f0ff0d84
commit f62539ad55

View File

@ -4337,6 +4337,15 @@
absdest)
:file (bundle/add-file manifest src dest chmod-mode)))
(defn bundle/add-bin
`Shorthand for adding scripts during an install. Scripts will be installed to
(string (dyn *syspath*) "/bin") by default and will be set to be executable.`
[manifest src &opt dest chmod-mode]
(default dest (string "bin" (sep) (->> src (string/split "/") last)))
(default chmod-mode 8r755)
(os/mkdir (string (dyn *syspath*) (sep) "bin"))
(bundle/add-file manifest src dest chmod-mode))
(defn bundle/update-all
"Reinstall all bundles"
[&keys configs]