diff options
| author | ruki <[email protected]> | 2020-11-08 21:40:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-11-08 21:40:57 +0800 |
| commit | 6f58d347401697543a16d0a7f93cb5b401908fb0 (patch) | |
| tree | 75160b3407b691ec5baed61fd04a53ffe3a4694a /xmake/core/base/interpreter.lua | |
| parent | 89ca182fc97765d4e2a7bb57a565044fdca07586 (diff) | |
fix os.scriptdir
Diffstat (limited to 'xmake/core/base/interpreter.lua')
| -rw-r--r-- | xmake/core/base/interpreter.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index 99ed8e2da..818ff9576 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -723,6 +723,9 @@ function interpreter:load(file, opt) -- clear first self:_clear() + -- translate to absolute file path for scriptdir/rootdir + file = path.absolute(file) + -- init the current file self._PRIVATE._CURFILE = file self._PRIVATE._SCRIPT_FILES = {file} @@ -784,11 +787,7 @@ end -- get script directory function interpreter:scriptdir() - - -- check assert(self and self._PRIVATE and self._PRIVATE._CURFILE) - - -- get it return path.directory(self._PRIVATE._CURFILE) end |
