summaryrefslogtreecommitdiff
path: root/xmake/core/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/main.lua')
-rw-r--r--xmake/core/main.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua
index 5e11acd28..6706b448d 100644
--- a/xmake/core/main.lua
+++ b/xmake/core/main.lua
@@ -192,7 +192,13 @@ function main._init()
-- update and enter project
xmake._PROJECT_DIR = path.directory(projectfile)
xmake._PROJECT_FILE = projectfile
- xmake._WORKING_DIR = os.cd(xmake._PROJECT_DIR)
+
+ -- enter the project directory
+ if os.isdir(os.projectdir()) then
+ xmake._WORKING_DIR = os.cd(os.projectdir())
+ else
+ xmake._WORKING_DIR = os.curdir()
+ end
-- add the directory of the program file (xmake) to $PATH environment
local programfile = os.programfile()