summaryrefslogtreecommitdiff
path: root/xmake/core/base/os.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-06 00:54:46 +0800
committerruki <[email protected]>2020-02-07 22:45:57 +0800
commitdfef2f8ca41884138c5105cc7cbf55a67510f54d (patch)
tree0b3f363f7a8758b9a1c6ec6f8650cd9e45f20a95 /xmake/core/base/os.lua
parentd40841b322485ec4200a857979b2ea77677a906a (diff)
fix curdir for scheduler
Diffstat (limited to 'xmake/core/base/os.lua')
-rw-r--r--xmake/core/base/os.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 35099cc9e..a2c6eb3be 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -155,6 +155,11 @@ function os._ramdir()
return ramdir_root or nil
end
+-- set on change directory callback for scheduler
+function os._sched_chdir_set(chdir)
+ os._SCHED_CHDIR = chdir
+end
+
-- translate arguments for wildcard
function os.argw(argv)
@@ -459,6 +464,11 @@ function os.cd(dir)
return nil, string.format("cannot change directory %s, not found this directory %s", dir, os.strerror())
end
+ -- do chdir callback for scheduler
+ if os._SCHED_CHDIR then
+ os._SCHED_CHDIR(oldir, os.curdir())
+ end
+
-- ok
return oldir
end