mirror of
https://github.com/janet-lang/janet
synced 2025-11-09 20:13:02 +00:00
Make installed manifests nicer to work with.
This commit is contained in:
@@ -4118,7 +4118,11 @@
|
|||||||
[manifest]
|
[manifest]
|
||||||
(def bn (get manifest :name))
|
(def bn (get manifest :name))
|
||||||
(def manifest-name (get-manifest-filename bn))
|
(def manifest-name (get-manifest-filename bn))
|
||||||
(spit manifest-name (string/format "%j\n" manifest)))
|
(def b @"")
|
||||||
|
(buffer/format b "%j" manifest) # make sure it is valid jdn
|
||||||
|
(buffer/clear b)
|
||||||
|
(buffer/format b "%.99m\n" manifest)
|
||||||
|
(spit manifest-name b))
|
||||||
|
|
||||||
(defn bundle/manifest
|
(defn bundle/manifest
|
||||||
"Get the manifest for a give installed bundle"
|
"Get the manifest for a give installed bundle"
|
||||||
@@ -4430,10 +4434,11 @@
|
|||||||
`Shorthand for adding scripts during an install. Scripts will be installed to
|
`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.`
|
(string (dyn *syspath*) "/bin") by default and will be set to be executable.`
|
||||||
[manifest src &opt dest chmod-mode]
|
[manifest src &opt dest chmod-mode]
|
||||||
(default dest (last (string/split "/" src)))
|
(def s (sep))
|
||||||
|
(default dest (last (string/split s src)))
|
||||||
(default chmod-mode 8r755)
|
(default chmod-mode 8r755)
|
||||||
(os/mkdir (string (dyn *syspath*) (sep) "bin"))
|
(os/mkdir (string (dyn *syspath*) s "bin"))
|
||||||
(bundle/add-file manifest src (string "bin" (sep) dest) chmod-mode))
|
(bundle/add-file manifest src (string "bin" s dest) chmod-mode))
|
||||||
|
|
||||||
(defn bundle/update-all
|
(defn bundle/update-all
|
||||||
"Reinstall all bundles"
|
"Reinstall all bundles"
|
||||||
|
|||||||
Reference in New Issue
Block a user