summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-29 16:44:12 +0800
committerruki <[email protected]>2022-05-29 16:44:12 +0800
commit28b9b472ca6abb227ca6ac0b7ff7d48a2fedac7a (patch)
treed04984a2db61cf53066c33076bd38dba53d59b34
parent7e86c052217b255c95e3cd780bdee4153dd3c9bd (diff)
improve rundir for xmake run
-rw-r--r--xmake/actions/run/main.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/xmake/actions/run/main.lua b/xmake/actions/run/main.lua
index 50711ffbc..68a2e3863 100644
--- a/xmake/actions/run/main.lua
+++ b/xmake/actions/run/main.lua
@@ -44,9 +44,6 @@ function _do_run_target(target)
-- get the absolute target file path
local targetfile = path.absolute(target:targetfile())
- -- enter the run directory
- local oldir = os.cd(rundir)
-
-- add run environments
local addrunenvs, setrunenvs = make_runenvs(target)
for name, values in pairs(addrunenvs) do
@@ -58,13 +55,10 @@ function _do_run_target(target)
-- debugging?
if option.get("debug") then
- debugger.run(targetfile, option.get("arguments"))
+ debugger.run(targetfile, option.get("arguments"), {curdir = rundir})
else
- os.execv(targetfile, option.get("arguments"), {detach = option.get("detach")})
+ os.execv(targetfile, option.get("arguments"), {curdir = rundir, detach = option.get("detach")})
end
-
- -- restore the previous directory
- os.cd(oldir)
end
-- run target