summaryrefslogtreecommitdiff
path: root/xmake/core/base/os.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-30 22:49:54 +0800
committerruki <[email protected]>2020-04-30 10:59:28 +0800
commitbcf967b2abd338f9bcd3de403d5ebbaabf963d94 (patch)
treeae6d42e93489dccf50e865db541b540c0ce71455 /xmake/core/base/os.lua
parent7ddd265b1a3f420103dccdc0075c7a0e0679ccbb (diff)
improve errors msg
Diffstat (limited to 'xmake/core/base/os.lua')
-rw-r--r--xmake/core/base/os.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index f4acb808c..44b11a6f7 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -59,7 +59,7 @@ function os._cp(src, dst, rootdir)
src = path.absolute(src)
end
if not src:startswith(rootdir) then
- return false, string.format("cannot copy file %s to %s, error: invalid rootdir(%s)", src, dst, rootdir)
+ return false, string.format("cannot copy file %s to %s, invalid rootdir(%s)", src, dst, rootdir)
end
end
@@ -77,7 +77,7 @@ function os._cp(src, dst, rootdir)
-- copy file
if not os.cpfile(src, dst) then
- return false, string.format("cannot copy file %s to %s, error: %s", src, dst, os.strerror())
+ return false, string.format("cannot copy file %s to %s, %s", src, dst, os.strerror())
end
-- is directory?
elseif os.isdir(src) then
@@ -93,12 +93,12 @@ function os._cp(src, dst, rootdir)
-- copy directory
if not os.cpdir(src, dst) then
- return false, string.format("cannot copy directory %s to %s, error: %s", src, dst, os.strerror())
+ return false, string.format("cannot copy directory %s to %s, %s", src, dst, os.strerror())
end
-- not exists?
else
- return false, string.format("cannot copy file %s, error: not found this file", src)
+ return false, string.format("cannot copy file %s, not found this file", src)
end
-- ok
@@ -438,7 +438,7 @@ function os.ln(srcpath, dstpath)
return false, string.format("symlink is not supported!")
end
if not os.link(srcpath, dstpath) then
- return false, string.format("cannot link %s to %s, error: %s", srcpath, dstpath, os.strerror())
+ return false, string.format("cannot link %s to %s, %s", srcpath, dstpath, os.strerror())
end
return true
end
@@ -501,7 +501,7 @@ function os.mkdir(dir)
local dirs = table.wrap(os._match_wildcard_pathes(dir))
for _, _dir in ipairs(dirs) do
if not os._mkdir(_dir) then
- return false, string.format("cannot create directory: %s, error: %s", _dir, os.strerror())
+ return false, string.format("cannot create directory: %s, %s", _dir, os.strerror())
end
end
return true
@@ -519,7 +519,7 @@ function os.rmdir(dir)
local dirs = table.wrap(os._match_wildcard_pathes(dir))
for _, _dir in ipairs(dirs) do
if not os._rmdir(_dir) then
- return false, string.format("cannot remove directory: %s, error: %s", _dir, os.strerror())
+ return false, string.format("cannot remove directory: %s, %s", _dir, os.strerror())
end
end
return true
@@ -630,7 +630,7 @@ function os.runv(program, argv, opt)
errors = string.format("runv(%s) failed(%d)", cmd, ok)
end
else
- errors = string.format("cannot runv(%s), error: %s", cmd, errors and errors or "unknown")
+ errors = string.format("cannot runv(%s), %s", cmd, errors and errors or "unknown reason")
end
-- remove the temporary log file
@@ -753,7 +753,7 @@ function os.iorunv(program, argv, opt)
if argv then
cmd = cmd .. " " .. os.args(argv)
end
- errors = string.format("cannot runv(%s), error: %s", cmd, errors and errors or "unknown")
+ errors = string.format("cannot runv(%s), %s", cmd, errors and errors or "unknown reason")
end
-- get output and error data