Update os/stat

os/stat can now take a keyword as the second argument
to avoid creating a table if one only wants on value
from stat.
This commit is contained in:
Calvin Rose
2019-04-01 11:11:15 -04:00
parent 429dc70374
commit b15cf193a0
3 changed files with 98 additions and 31 deletions
+6 -4
View File
@@ -18,11 +18,13 @@
(os/exit res)))
(defn- rm
"Remove a directory. Not safe for user code."
"Remove a directory and all sub directories."
[path]
(if is-win
(shell "rmdir " path " /s")
(shell "rm -rf " path)))
(if (= ((os/stat path) :mode) :directory)
(do
(each subpath (os/dir path) (rm subpath))
(os/rmdir path))
(os/rm path)))
(defn- needs-build
[dest src]
+1 -1
View File
@@ -74,7 +74,7 @@
"Generate title"
[]
(string "<h1>Janet Core API</h1>"
"<p>Version " janet/version "-" janet/build "</p>"
"<p>Version " janet/version "-" janet/build "</p>"
"<p>Generated "
(nice-date)
"</p>"