mirror of
https://github.com/janet-lang/janet
synced 2025-11-02 16:43:02 +00:00
Update cook tool to export shell function.
This commit is contained in:
@@ -8,14 +8,16 @@
|
||||
(def- objext (if is-win ".obj" ".o"))
|
||||
(def- modext (if is-win ".dll" ".so"))
|
||||
|
||||
(defn- shell
|
||||
(def prefix (or (os/getenv "PREFIX") "/usr/local"))
|
||||
|
||||
(defn shell
|
||||
"Do a shell command"
|
||||
[& args]
|
||||
(print ;args)
|
||||
(def res (os/shell (string ;args)))
|
||||
(def cmd (string ;args))
|
||||
(print cmd)
|
||||
(def res (os/shell cmd))
|
||||
(unless (zero? res)
|
||||
(print "Error executing command: " ;args)
|
||||
(os/exit res)))
|
||||
(error "command exited with status " res)))
|
||||
|
||||
(defn- rm
|
||||
"Remove a directory and all sub directories."
|
||||
|
||||
Reference in New Issue
Block a user