Skip to content

Commit

Permalink
Add shorthand for installing scripts via bundle/add-bin.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bakpakin committed Jul 12, 2024
1 parent 31f0ff0 commit f62539a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/boot/boot.janet
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit f62539a

Please sign in to comment.