mirror of
https://github.com/janet-lang/janet
synced 2025-10-18 01:07:40 +00:00
Add bundle/add-manpage
This commit is contained in:

committed by
Calvin Rose

parent
6b8e5249ca
commit
f393531335
@@ -4386,7 +4386,10 @@
|
||||
(print "installed " bundle-name)
|
||||
(when (get man :has-bin-script)
|
||||
(def binpath (string (dyn *syspath*) s "bin"))
|
||||
(eprintf "executable scripts have been installed to %s" binpath))
|
||||
(eprintf "executable files have been installed to %s" binpath))
|
||||
(when (get man :has-man)
|
||||
(def manpath (string (dyn *syspath*) s "man"))
|
||||
(eprintf "man pages have been installed to %s" manpath))
|
||||
bundle-name)
|
||||
|
||||
(defn- bundle/pack
|
||||
@@ -4514,8 +4517,8 @@
|
||||
(errorf "bad path %s - file is a %s" src mode)))
|
||||
|
||||
(defn bundle/add-bin
|
||||
``Add a script to the bin subdirectory of the current syspath. Scripts will
|
||||
be set to be executable.``
|
||||
``Add a file to the "bin" subdirectory of the current syspath. By default,
|
||||
files will be set to be executable.``
|
||||
[manifest src &opt filename chmod-mode]
|
||||
(def s (sep))
|
||||
(default filename (last (string/split s src)))
|
||||
@@ -4524,6 +4527,18 @@
|
||||
(put manifest :has-bin-script true)
|
||||
(bundle/add-file manifest src (string "bin" s filename) chmod-mode))
|
||||
|
||||
(defn bundle/add-manpage
|
||||
``Add a file to the man subdirectory of the current syspath. Files are
|
||||
copied inside a directory `mansec`. By default, `mansec` is "man1".``
|
||||
[manifest src &opt mansec]
|
||||
(def s (sep))
|
||||
(default mansec "man1")
|
||||
(def filename (last (string/split s src)))
|
||||
(os/mkdir (string (dyn *syspath*) s "man"))
|
||||
(os/mkdir (string (dyn *syspath*) s "man" s mansec))
|
||||
(put manifest :has-man true)
|
||||
(bundle/add-file manifest src (string "man" s mansec s filename)))
|
||||
|
||||
(defn bundle/update-all
|
||||
"Reinstall all bundles."
|
||||
[&keys configs]
|
||||
|
Reference in New Issue
Block a user