diff options
| author | ruki <[email protected]> | 2025-11-04 22:30:32 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-07 15:01:57 +0800 |
| commit | 5511722baa97e852b83227c2fde12039108fbbc1 (patch) | |
| tree | 3e4b70cb44dd367dda62338ccc94d413f7419acd /xmake/modules/utils/run_script.lua | |
| parent | 9d1775d653a98559e9b51b639fd70e93760c268d (diff) | |
fix bin2c thread
Diffstat (limited to 'xmake/modules/utils/run_script.lua')
| -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() |
