diff options
| author | ruki <[email protected]> | 2020-09-03 00:50:52 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-09-03 00:50:52 +0800 |
| commit | a2afa87f41211dab3c2ce6cd590bb305f7960c20 (patch) | |
| tree | 6c29146275430f323b12834ee6c5cd8c0d6cff11 | |
| parent | f4201580b8fe687c3ec5fdae0960812e7b9a9706 (diff) | |
fix curdir
| -rw-r--r-- | xmake/actions/build/build.lua | 4 | ||||
| -rw-r--r-- | xmake/actions/build/build_files.lua | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/xmake/actions/build/build.lua b/xmake/actions/build/build.lua index dd40fe0c9..3271cf378 100644 --- a/xmake/actions/build/build.lua +++ b/xmake/actions/build/build.lua @@ -218,12 +218,14 @@ function main(targetname) -- build all jobs local batchjobs = get_batchjobs(targetname) if batchjobs and batchjobs:size() > 0 then + local curdir = os.curdir() runjobs("build", batchjobs, {comax = option.get("jobs") or 1, on_exit = function (errors) import("private.utils.progress") if errors and progress.showing_without_scroll() then print("") end - end, curdir = os.curdir()}) + end, curdir = curdir}) + os.cd(curdir) end end diff --git a/xmake/actions/build/build_files.lua b/xmake/actions/build/build_files.lua index 3bd4804df..26e85fc64 100644 --- a/xmake/actions/build/build_files.lua +++ b/xmake/actions/build/build_files.lua @@ -205,7 +205,9 @@ function main(targetname, sourcefiles) -- build all jobs local batchjobs = _get_batchjobs(targetname, filepatterns) if batchjobs and batchjobs:size() > 0 then - runjobs("build_files", batchjobs, {comax = option.get("jobs") or 1}) + local curdir = os.curdir() + runjobs("build_files", batchjobs, {comax = option.get("jobs") or 1, curdir = curdir}) + os.cd(curdir) end end |
