diff options
| -rw-r--r-- | xmake/actions/run/main.lua | 10 |
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 |
