Cleaner py detection

This commit is contained in:
CorpNewt
2019-06-07 10:55:59 -05:00
committed by GitHub
parent cd0fa18415
commit 2003eff896
+6 -6
View File
@@ -6,6 +6,7 @@ set "script_name=%~n0.command"
set "thisDir=%~dp0"
set /a tried=0
set "toask=yes"
set "python="
goto checkscript
@@ -24,10 +25,9 @@ goto checkpy
:checkpy
REM Get python location
set "python="
FOR /F "tokens=* USEBACKQ" %%F IN (`python -V 2^>^&1`) DO (
set "t=%%F"
if /i "!t:~0,6!" == "python" (
set "dummypath=%USERPROFILE%\AppData\Local\Microsoft\WindowsApps\python.exe"
FOR /F "tokens=* USEBACKQ" %%F IN (`where python`) DO (
if /i not "%%F" == "!dummypath!" (
set "python=%%F"
)
)
@@ -178,8 +178,8 @@ exit /b
REM Python found
cls
if "%*"=="" (
python "!thisDir!!script_name!"
"!python!" "!thisDir!!script_name!"
) else (
python "!thisDir!!script_name!" %*
"!python!" "!thisDir!!script_name!" %*
)
goto :EOF