summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/sandbox/modules/import/core/project/project.lua5
-rw-r--r--xmake/modules/private/xrepo/action/env.lua2
2 files changed, 5 insertions, 2 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua
index 12b133b37..f515b3e74 100644
--- a/xmake/core/sandbox/modules/import/core/project/project.lua
+++ b/xmake/core/sandbox/modules/import/core/project/project.lua
@@ -160,7 +160,10 @@ function sandbox_core_project.unlock()
end
-- change project file and directory (xmake.lua)
-function sandbox_core_project.changefile(projectfile)
+function sandbox_core_project.chdir(projectdir, projectfile)
+ if not projectfile then
+ projectfile = path.join(projectdir, "xmake.lua")
+ end
xmake._PROJECT_FILE = projectfile
xmake._PROJECT_DIR = path.directory(projectfile)
xmake._WORKING_DIR = xmake._PROJECT_DIR
diff --git a/xmake/modules/private/xrepo/action/env.lua b/xmake/modules/private/xrepo/action/env.lua
index 7db7e7459..8590fcab9 100644
--- a/xmake/modules/private/xrepo/action/env.lua
+++ b/xmake/modules/private/xrepo/action/env.lua
@@ -139,7 +139,7 @@ function _enter_project(opt)
os.cd(workdir)
end
if opt.enteronly then
- project.changefile(path.join(workdir, "xmake.lua"))
+ project.chdir(workdir)
return
end