diff options
| author | ruki <[email protected]> | 2025-11-09 08:28:01 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-11-09 08:28:01 +0800 |
| commit | a1b0ec856e2c22aac84022feb05b6687912e3d6e (patch) | |
| tree | a4679af3be46069a480be76bdc322eeeefcc4049 /xmake/modules/utils | |
| parent | 0b91f564b00bf22d611a70c17088ba3a155b8a84 (diff) | |
| parent | 91ef5fa9376814db12d35a020008a0d692883945 (diff) | |
Merge pull request #6989 from xmake-io/async
Add async support in os APIs
Diffstat (limited to 'xmake/modules/utils')
| -rw-r--r-- | xmake/modules/utils/run_script.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/xmake/modules/utils/run_script.lua b/xmake/modules/utils/run_script.lua index a5ab2fa50..82fa8cb0d 100644 --- a/xmake/modules/utils/run_script.lua +++ b/xmake/modules/utils/run_script.lua @@ -150,14 +150,19 @@ function _run(script, opt) option.set("quiet", true, {force = true}) end - local curdir = opt.curdir or os.workingdir() - local oldir = os.cd(curdir) + local oldir + if xmake.in_main_thread() then + local curdir = opt.curdir or os.workingdir() + oldir = os.cd(curdir) + end if opt.command then _run_commanad(script, _get_args(opt), opt) else _run_script(script, _get_args(opt), opt) end - os.cd(oldir) + if oldir then + os.cd(oldir) + end if opt.quiet then option.restore() |
