Skip to content

Commit f393531

Browse files
pyrmontbakpakin
authored andcommitted
Add bundle/add-manpage
1 parent 6b8e524 commit f393531

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/boot/boot.janet

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4386,7 +4386,10 @@
43864386
(print "installed " bundle-name)
43874387
(when (get man :has-bin-script)
43884388
(def binpath (string (dyn *syspath*) s "bin"))
4389-
(eprintf "executable scripts have been installed to %s" binpath))
4389+
(eprintf "executable files have been installed to %s" binpath))
4390+
(when (get man :has-man)
4391+
(def manpath (string (dyn *syspath*) s "man"))
4392+
(eprintf "man pages have been installed to %s" manpath))
43904393
bundle-name)
43914394

43924395
(defn- bundle/pack
@@ -4514,8 +4517,8 @@
45144517
(errorf "bad path %s - file is a %s" src mode)))
45154518

45164519
(defn bundle/add-bin
4517-
``Add a script to the bin subdirectory of the current syspath. Scripts will
4518-
be set to be executable.``
4520+
``Add a file to the "bin" subdirectory of the current syspath. By default,
4521+
files will be set to be executable.``
45194522
[manifest src &opt filename chmod-mode]
45204523
(def s (sep))
45214524
(default filename (last (string/split s src)))
@@ -4524,6 +4527,18 @@
45244527
(put manifest :has-bin-script true)
45254528
(bundle/add-file manifest src (string "bin" s filename) chmod-mode))
45264529

4530+
(defn bundle/add-manpage
4531+
``Add a file to the man subdirectory of the current syspath. Files are
4532+
copied inside a directory `mansec`. By default, `mansec` is "man1".``
4533+
[manifest src &opt mansec]
4534+
(def s (sep))
4535+
(default mansec "man1")
4536+
(def filename (last (string/split s src)))
4537+
(os/mkdir (string (dyn *syspath*) s "man"))
4538+
(os/mkdir (string (dyn *syspath*) s "man" s mansec))
4539+
(put manifest :has-man true)
4540+
(bundle/add-file manifest src (string "man" s mansec s filename)))
4541+
45274542
(defn bundle/update-all
45284543
"Reinstall all bundles."
45294544
[&keys configs]

0 commit comments

Comments
 (0)