mirror of
https://github.com/janet-lang/janet
synced 2025-11-09 20:13:02 +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:
@@ -4337,6 +4337,15 @@
|
|||||||
absdest)
|
absdest)
|
||||||
:file (bundle/add-file manifest src dest chmod-mode)))
|
: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
|
(defn bundle/update-all
|
||||||
"Reinstall all bundles"
|
"Reinstall all bundles"
|
||||||
[&keys configs]
|
[&keys configs]
|
||||||
|
|||||||
Reference in New Issue
Block a user