summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
authorruki <[email protected]>2016-07-04 14:33:50 +0800
committerruki <[email protected]>2016-07-04 14:33:50 +0800
commit1ec6011956e78dedd7eea87f484b0a3c56cfef27 (patch)
treec762bc26e0483b9082ff70eed890b7bef468f98d /xmake/core
parent2acc00d97e75abee7e1871f699c69136d37c4e49 (diff)
fix cd bug
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/sandbox/modules/os.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua
index 7930ae3b2..c8341a160 100644
--- a/xmake/core/sandbox/modules/os.lua
+++ b/xmake/core/sandbox/modules/os.lua
@@ -97,12 +97,17 @@ function sandbox_os.cd(dir)
-- format it first
dir = vformat(dir)
+ -- the previous directory
+ local olddir = os.curdir()
+
-- done
local ok, errors = os.cd(dir)
if not ok then
os.raise(errors)
end
+ -- ok
+ return olddir
end
-- create directory