Improve env setup script
This commit is contained in:
1 parent
74969a3adb
commit
ecc381851f
1 file changed
+36
-6
+36
-6
@@ -1,6 +1,36 @@
|
|||||||
@set /p "choice=Install PyInstaller so you can build an EXEcutable? (y/n) "
|
@echo off
|
||||||
python -m venv env
|
set /p "choice=Install PyInstaller so you can build an EXEcutable? (y/n) "
|
||||||
%CD%/env/scripts/pip install wheel
|
set dirpath=%~dp0
|
||||||
%CD%/env/scripts/pip install -r %CD%/requirements.txt
|
if "%dirpath:~-1%" == "\" set dirpath=%dirpath:~0,-1%
|
||||||
if "%choice%" == "y" %CD%/env/scripts/pip install pyinstaller
|
git -v > nul
|
||||||
%CD%/env/scripts/python %CD%/env/scripts/pywin32_postinstall.py -install -silent
|
if %errorlevel% NEQ 0 goto NOGIT
|
||||||
|
if not exist "%dirpath%\env" (
|
||||||
|
echo:
|
||||||
|
echo Creating the env folder...
|
||||||
|
python -m venv "%dirpath%\env"
|
||||||
|
if %errorlevel% NEQ 0 goto NOPYTHON
|
||||||
|
)
|
||||||
|
echo:
|
||||||
|
echo Installing requirements.txt...
|
||||||
|
"%dirpath%\env\scripts\pip" install wheel
|
||||||
|
"%dirpath%\env\scripts\pip" install -r "%dirpath%\requirements.txt"
|
||||||
|
echo:
|
||||||
|
echo Installing PyInstaller...
|
||||||
|
if "%choice%" == "y" "%dirpath%\env\scripts\pip" install pyinstaller
|
||||||
|
"%dirpath%\env\scripts\python" "%dirpath%\env\scripts\pywin32_postinstall.py" -install -silent
|
||||||
|
goto DONE
|
||||||
|
:NOPYTHON
|
||||||
|
echo:
|
||||||
|
echo No python executable found in path!
|
||||||
|
pause
|
||||||
|
goto END
|
||||||
|
:NOGIT
|
||||||
|
echo:
|
||||||
|
echo No git executable found in path!
|
||||||
|
pause
|
||||||
|
goto END
|
||||||
|
:DONE
|
||||||
|
echo:
|
||||||
|
echo All done!
|
||||||
|
pause
|
||||||
|
:END
|
||||||
Reference in new issue
Block a user