summaryrefslogtreecommitdiff
path: root/xmake/core/base/os.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-21 22:47:02 +0800
committerruki <[email protected]>2020-02-21 10:42:12 +0800
commit868450acbb14b1bf5cd2da7b1b09a195e88a6bd5 (patch)
tree1f819dfe83532688d67f417069ffa4d0246d3933 /xmake/core/base/os.lua
parentfd61c350299a4d888bb3e81594077224e5fb4252 (diff)
improve strerror and os
Diffstat (limited to 'xmake/core/base/os.lua')
-rw-r--r--xmake/core/base/os.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 6b1366ac8..de67d636b 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -440,8 +440,9 @@ function os.rm(...)
-- remove directories
for _, filedir in ipairs(os.argw(args)) do
- if not os._rm(filedir) then
- return false, string.format("remove: %s failed!", filedir)
+ local ok, errors = os._rm(filedir)
+ if not ok then
+ return false, errors
end
end
@@ -455,7 +456,7 @@ function os.ln(filedir, symfile)
return false, string.format("symlink is not supported!")
end
if not os.link(filedir, symfile) then
- return false, string.format("link %s to %s failed!", filedir, symfile)
+ return false, string.format("cannot link %s to %s, error: %s", filedir, symfile, os.strerror())
end
return true
end