mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Fix Windows template
This commit is contained in:
parent
ec4228edc1
commit
7cff2818e4
1 changed files with 23 additions and 18 deletions
|
|
@ -9,27 +9,32 @@ call set "CLEAN_PATH=%%PATH:%SHIM_DIR%;=%%"
|
||||||
REM Determine invoked name (python or python3) from the script name
|
REM Determine invoked name (python or python3) from the script name
|
||||||
set "INVOKED=%~n0"
|
set "INVOKED=%~n0"
|
||||||
|
|
||||||
REM Check for -m pip or -m pip3
|
REM Check for -m pip or -m pip3 without parentheses to avoid parser issues
|
||||||
if "%1"=="-m" (
|
if /I "%1" NEQ "-m" goto FALLBACK
|
||||||
if /I "%2"=="pip3" (
|
|
||||||
shift
|
set "SECOND=%2"
|
||||||
shift
|
if /I "%SECOND%"=="pip3" goto CALL_PIP3
|
||||||
set "PATH=%CLEAN_PATH%" & aikido-pip3 %*
|
if /I "%SECOND%"=="pip" goto CALL_PIP
|
||||||
goto :eof
|
goto FALLBACK
|
||||||
)
|
|
||||||
if /I "%2"=="pip" (
|
:CALL_PIP3
|
||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
if /I "%INVOKED%"=="python3" (
|
set "PATH=%CLEAN_PATH%" & aikido-pip3 %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
set "PATH=%CLEAN_PATH%" & aikido-pip3 %*
|
goto :eof
|
||||||
) else (
|
|
||||||
set "PATH=%CLEAN_PATH%" & aikido-pip %*
|
:CALL_PIP
|
||||||
)
|
shift
|
||||||
goto :eof
|
shift
|
||||||
)
|
if /I "%INVOKED%"=="python3" (
|
||||||
|
set "PATH=%CLEAN_PATH%" & aikido-pip3 %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
) else (
|
||||||
|
set "PATH=%CLEAN_PATH%" & aikido-pip %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
)
|
)
|
||||||
|
goto :eof
|
||||||
|
|
||||||
REM Fallback to real python/python3 matching the invoked name
|
REM Fallback to real python/python3 matching the invoked name
|
||||||
|
:FALLBACK
|
||||||
for /f "tokens=*" %%i in ('set "PATH=%CLEAN_PATH%" ^& where %INVOKED% 2^>nul') do (
|
for /f "tokens=*" %%i in ('set "PATH=%CLEAN_PATH%" ^& where %INVOKED% 2^>nul') do (
|
||||||
"%%i" %*
|
"%%i" %*
|
||||||
goto :eof
|
goto :eof
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue