mirror of
https://github.com/corpnewt/gibMacOS.git
synced 2024-09-20 09:30:34 +00:00
Cleaner py detection
This commit is contained in:
parent
894503584d
commit
71227c208f
1 changed files with 7 additions and 11 deletions
16
gibMacOS.bat
16
gibMacOS.bat
|
@ -6,6 +6,7 @@ set "script_name=%~n0.command"
|
||||||
set "thisDir=%~dp0"
|
set "thisDir=%~dp0"
|
||||||
set /a tried=0
|
set /a tried=0
|
||||||
set "toask=yes"
|
set "toask=yes"
|
||||||
|
set "python="
|
||||||
|
|
||||||
goto checkscript
|
goto checkscript
|
||||||
|
|
||||||
|
@ -24,17 +25,12 @@ goto checkpy
|
||||||
|
|
||||||
:checkpy
|
:checkpy
|
||||||
REM Get python location
|
REM Get python location
|
||||||
set "python="
|
set "dummypath=%USERPROFILE%\AppData\Local\Microsoft\WindowsApps\python.exe"
|
||||||
FOR /F "tokens=* USEBACKQ" %%F IN (`python -V 2^>^&1`) DO (
|
FOR /F "tokens=* USEBACKQ" %%F IN (`where python`) DO (
|
||||||
set "t=%%F"
|
if /i not "%%F" == "!dummypath!" (
|
||||||
if /i "!t:~0,6!" == "python" (
|
|
||||||
REM Might have python installed - let's check for the store message
|
|
||||||
if /i "!t:was not found=!" == "!t!" (
|
|
||||||
REM There was no change - we found it.
|
|
||||||
set "python=%%F"
|
set "python=%%F"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
REM Check for py and give helpful hints!
|
REM Check for py and give helpful hints!
|
||||||
if /i "!python!"=="" (
|
if /i "!python!"=="" (
|
||||||
|
@ -182,8 +178,8 @@ exit /b
|
||||||
REM Python found
|
REM Python found
|
||||||
cls
|
cls
|
||||||
if "%*"=="" (
|
if "%*"=="" (
|
||||||
python "!thisDir!!script_name!"
|
"!python!" "!thisDir!!script_name!"
|
||||||
) else (
|
) else (
|
||||||
python "!thisDir!!script_name!" %*
|
"!python!" "!thisDir!!script_name!" %*
|
||||||
)
|
)
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
Loading…
Reference in a new issue