diff options
| author | 2026-02-14 10:42:36 -0600 | |
|---|---|---|
| committer | 2026-02-14 10:42:36 -0600 | |
| commit | db067ba7bc91b54459563e78697274badd405274 (patch) | |
| tree | 82e3537d51710b87c84f21be3b58b1949b3aed75 | |
| parent | Redo order. (diff) | |
Xcopy create directory if doesn't exist.
| -rw-r--r-- | spork/sh.janet | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spork/sh.janet b/spork/sh.janet index 80edb51..089055a 100644 --- a/spork/sh.janet +++ b/spork/sh.janet @@ -159,11 +159,14 @@ (let [end (last (path/parts src)) isdir (= (os/stat src :mode) :directory) dest-isdir (= (os/stat dest :mode) :directory)] + (def srcfile (path/win32/join ;(path/parts src))) + (def destfile (path/win32/join ;(if (or dest-isdir isdir) [;(path/parts dest) end] (path/parts dest)))) + (if (or isdir dest-isdir) (spit destfile "")) # xcopy copies important extra file attributes that a normal copy seems not to. (os/execute ["C:\\Windows\\System32\\xcopy.exe" - (path/win32/join ;(path/parts src)) - (path/win32/join ;(if (or dest-isdir isdir) [;(path/parts dest) end] (path/parts dest))) + srcfile + destfile "/y" "/s" "/e" "/f" "/i" "/k"] :px)) (os/execute ["cp" "-rf" src dest] :px))) |
