summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorxq114 <[email protected]>2023-03-23 16:03:11 +0800
committerxq114 <[email protected]>2023-03-23 16:03:11 +0800
commitdf31f7516538cb4049110c89f290c7a398a58f3b (patch)
treeea2e9879d109e22bdfab602dfa367d309f464b71 /scripts
parent19c31069f6336cb969f9fefc059890f3cc64d2d8 (diff)
detect corrupt xmake.lua for virtual environment
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/xrepo.bat18
1 files changed, 17 insertions, 1 deletions
diff --git a/scripts/xrepo.bat b/scripts/xrepo.bat
index 0416d4a10..7a5926cdb 100755
--- a/scripts/xrepo.bat
+++ b/scripts/xrepo.bat
@@ -35,6 +35,14 @@
exit /B 1
) else (
setlocal EnableDelayedExpansion
+ @%XMAKE_EXE% lua --quiet private.xrepo.action.env | findstr . && (
+ echo error: corrupt xmake.lua detected in the current directory^^!
+ exit /B 1
+ )
+ @%XMAKE_EXE% lua --quiet private.xrepo.action.env
+ if !errorlevel! neq 0 (
+ exit /B !errorlevel!
+ )
%XMAKE_EXE% lua private.xrepo.action.env.info config
if !errorlevel! neq 0 (
exit /B !errorlevel!
@@ -77,10 +85,18 @@
set PROMPT=%XMAKE_PROMPT_BACKUP%
set XMAKE_ENV_BACKUP=
set XMAKE_PROMPT_BACKUP=
- echo Please rerun `xrepo env shell` to enter the environment.
+ echo Please rerun `xrepo env %2 %3 shell` to enter the environment.
exit /B 1
) else (
setlocal EnableDelayedExpansion
+ @%XMAKE_EXE% lua --quiet private.xrepo.action.env | findstr . && (
+ echo error: corrupt xmake.lua detected in the current directory^^!
+ exit /B 1
+ )
+ @%XMAKE_EXE% lua --quiet private.xrepo.action.env
+ if !errorlevel! neq 0 (
+ exit /B !errorlevel!
+ )
%XMAKE_EXE% lua private.xrepo.action.env.info config %3
if !errorlevel! neq 0 (
exit /B !errorlevel!