summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-17 19:25:44 +0800
committerOpportunityLiu <[email protected]>2019-07-19 11:48:32 +0800
commit0c469ed3843a73b3fbf73640b75715f72fc7be53 (patch)
treeb8d34f5fc0c491b6b77bcac393731fb07a1492e0
parent623add4344bf5e5d29b116356de7d398c2ddec2f (diff)
fix setenv
-rw-r--r--xmake/core/base/os.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 6be21560c..53670360f 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -534,10 +534,10 @@ function os.runv(program, argv, opt)
opt = opt or {}
-- make temporary log file
- local log = os.tmpfile()
+ local logfile = os.tmpfile()
-- execute it
- local ok = os.execv(program, argv, table.join(opt, {stdout = log, stderr = log}))
+ local ok = os.execv(program, argv, table.join(opt, {stdout = logfile, stderr = logfile}))
if ok ~= 0 then
-- make errors
@@ -551,14 +551,14 @@ function os.runv(program, argv, opt)
end
-- remove the temporary log file
- os.rm(log)
+ os.rm(logfile)
-- failed
return false, errors
end
-- remove the temporary log file
- os.rm(log)
+ os.rm(logfile)
-- ok
return true
@@ -948,9 +948,9 @@ function os.setenv(name, ...)
local values = {...}
if #values <= 1 then
-- keep compatible with original implementation
- os._setenv(name, values[1] or "")
+ return os._setenv(name, values[1] or "")
else
- os._setenv(path.joinenv(values))
+ return os._setenv(path.joinenv(values))
end
end