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
|
||||
set "INVOKED=%~n0"
|
||||
|
||||
REM Check for -m pip or -m pip3
|
||||
if "%1"=="-m" (
|
||||
if /I "%2"=="pip3" (
|
||||
shift
|
||||
shift
|
||||
set "PATH=%CLEAN_PATH%" & aikido-pip3 %*
|
||||
goto :eof
|
||||
)
|
||||
if /I "%2"=="pip" (
|
||||
shift
|
||||
shift
|
||||
if /I "%INVOKED%"=="python3" (
|
||||
set "PATH=%CLEAN_PATH%" & aikido-pip3 %*
|
||||
) else (
|
||||
set "PATH=%CLEAN_PATH%" & aikido-pip %*
|
||||
)
|
||||
goto :eof
|
||||
)
|
||||
REM Check for -m pip or -m pip3 without parentheses to avoid parser issues
|
||||
if /I "%1" NEQ "-m" goto FALLBACK
|
||||
|
||||
set "SECOND=%2"
|
||||
if /I "%SECOND%"=="pip3" goto CALL_PIP3
|
||||
if /I "%SECOND%"=="pip" goto CALL_PIP
|
||||
goto FALLBACK
|
||||
|
||||
:CALL_PIP3
|
||||
shift
|
||||
shift
|
||||
set "PATH=%CLEAN_PATH%" & aikido-pip3 %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
goto :eof
|
||||
|
||||
:CALL_PIP
|
||||
shift
|
||||
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
|
||||
:FALLBACK
|
||||
for /f "tokens=*" %%i in ('set "PATH=%CLEAN_PATH%" ^& where %INVOKED% 2^>nul') do (
|
||||
"%%i" %*
|
||||
goto :eof
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue