1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-13 06:47:41 +00:00

Merge pull request #354 from andrewchambers/safeclean

Do not recurse into symlinks when cleaning.
This commit is contained in:
Calvin Rose
2020-04-21 13:21:42 -04:00
committed by GitHub

View File

@@ -267,7 +267,7 @@
"Remove a directory and all sub directories."
[path]
(try
(if (= (os/stat path :mode) :directory)
(if (= (os/lstat path :mode) :directory)
(do
(each subpath (os/dir path)
(rm (string path sep subpath)))