summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxq114 <[email protected]>2021-04-30 23:05:05 +0800
committerxq114 <[email protected]>2021-04-30 23:05:05 +0800
commit108410d9151b2ba67b011e858576ab7efdbd2176 (patch)
tree483c8c6d150445364cbe46bb40c7d3fe99babcdc
parent947cfffa942ec1160a68c614c296830991fc0710 (diff)
run config only in project directories
-rw-r--r--scripts/xrepo-hook.psm12
-rwxr-xr-xscripts/xrepo.bat4
-rw-r--r--xmake/modules/private/xrepo/action/env.lua4
3 files changed, 7 insertions, 3 deletions
diff --git a/scripts/xrepo-hook.psm1 b/scripts/xrepo-hook.psm1
index efd3f909e..5874203fd 100644
--- a/scripts/xrepo-hook.psm1
+++ b/scripts/xrepo-hook.psm1
@@ -15,7 +15,7 @@ function Enter-XrepoEnvironment {
begin {
$script:xrepoOldEnvs = (Get-ChildItem -Path Env:);
- & $Env:XMAKE_EXE config
+ & $Env:XMAKE_EXE lua private.xrepo.action.env.info config;
$xmakeColorTermBackup, $Env:XMAKE_COLORTERM = $Env:XMAKE_COLORTERM, "nocolor";
$xrepoPrompt = (& $Env:XMAKE_EXE lua private.xrepo.action.env.info prompt | Out-String);
diff --git a/scripts/xrepo.bat b/scripts/xrepo.bat
index cbf7a080e..1a4a230ca 100755
--- a/scripts/xrepo.bat
+++ b/scripts/xrepo.bat
@@ -18,7 +18,7 @@
call %XMAKE_ENV_BACKUP%
setlocal EnableDelayedExpansion
if !errorlevel! neq 0 exit /B !errorlevel!
- %XMAKE_EXE% config
+ %XMAKE_EXE% lua private.xrepo.action.env.info config
@%XMAKE_EXE% lua private.xrepo.action.env.info prompt 1>nul
if !errorlevel! neq 0 (
echo error: xmake.lua not found^^!
@@ -32,7 +32,7 @@
exit /B 1
) else (
setlocal EnableDelayedExpansion
- %XMAKE_EXE% config
+ %XMAKE_EXE% lua private.xrepo.action.env.info config
@%XMAKE_EXE% lua private.xrepo.action.env.info prompt 1>nul
if !errorlevel! neq 0 (
echo error: xmake.lua not found^^!
diff --git a/xmake/modules/private/xrepo/action/env.lua b/xmake/modules/private/xrepo/action/env.lua
index 8703a726c..fbce2a566 100644
--- a/xmake/modules/private/xrepo/action/env.lua
+++ b/xmake/modules/private/xrepo/action/env.lua
@@ -268,6 +268,10 @@ function info(key)
print("[%s]", path.filename(os.projectdir()))
elseif key == "envfile" then
print(os.tmpfile())
+ elseif key == "config" then
+ if os.isfile(os.projectfile()) then
+ task.run("config", {target = "all"}, {disable_dump = true})
+ end
elseif key:startswith("script.") then
local shell = key:match("script%.(.+)")
print(_get_env_script(_package_getenvs(), shell, false))