1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-26 07:03:16 +00:00

Get rid of robocopy nonsense.

xcopy works fine, just need /s flag.
This commit is contained in:
Calvin Rose 2019-08-29 02:57:47 -04:00
parent d4b49cd622
commit 730080e6fd

View File

@ -203,15 +203,6 @@
(unless (zero? res)
(error (string "command exited with status " res))))
(defn- shell2
"Do a shell command, but don't assum 0 is the (only) passing exit code."
[pred & args]
(if (dyn :verbose)
(print ;(interpose " " args)))
(def res (os/execute args :p))
(unless (pred res)
(error (string "command exited with status " res))))
(defn rm
"Remove a directory and all sub directories."
[path]
@ -227,11 +218,7 @@
[src dest]
(print "copying " src " to " dest "...")
(if is-win
(if (= (os/stat src :mode) :directory)
(let [dname (last (filter |(pos? (length $)) (string/split "/" src)))]
(shell2 |(< $ 9) "robocopy" "/MIR" "/COPY:DAT" "/NS" "/NS" "/NFL" "/NDL" "/NP" "/NJH" "/NJS"
src (string dest sep dname)))
(shell "xcopy" src dest "/y" "/e"))
(shell "xcopy" src dest "/y" "/s" "/e")
(shell "cp" "-rf" src dest)))
#