diff options
| -rw-r--r-- | xmake/core/base/interpreter.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index afb5e4412..f325ec3d2 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -770,7 +770,8 @@ function interpreter:load(file, opt) self:_clear() -- translate to absolute file path for scriptdir/rootdir - file = path.absolute(file) + -- we need to normalize path for rootdir, @see https://github.com/xmake-io/xmake/issues/6995 + file = path.normalize(path.absolute(file)) -- init the current file self._PRIVATE._CURFILE = file @@ -1865,11 +1866,8 @@ function interpreter:api_builtin_includes(...) -- clear the current scope, force to enter root scope scopes._CURRENT = nil - -- save the current directory - local oldir = os.curdir() - -- enter the script directory - os.cd(path.directory(file)) + local oldir = os.cd(path.directory(file)) -- done interpreter local ok, errors = xpcall(script, interpreter._traceback) |
