Skip to content

Commit

Permalink
Fix reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
biast12 authored and DevilXD committed Dec 31, 2024
1 parent f8fa68b commit 792d589
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 14 deletions.
20 changes: 17 additions & 3 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,39 @@ if not exist "%dirpath%\env" (
exit /b 1
)

REM Check if pyinstaller and pywin32 is installed in the virtual environment
REM Check if PyInstaller and pywin32 is installed in the virtual environment
if not exist "%dirpath%\env\scripts\pyinstaller.exe" (
echo Installing PyInstaller...
"%dirpath%\env\scripts\pip" install pyinstaller
if errorlevel 1 (
echo Failed to install pyinstaller.
echo:
echo Failed to install PyInstaller.
echo:
pause
exit /b 1
)
"%dirpath%\env\scripts\python" "%dirpath%\env\scripts\pywin32_postinstall.py" -install -silent
if errorlevel 1 (
echo:
echo Failed to run pywin32_postinstall.py.
echo:
pause
exit /b 1
)
)

REM Run pyinstaller with the specified build spec file
REM Run PyInstaller with the specified build spec file
echo Building...
"%dirpath%\env\scripts\pyinstaller" "%dirpath%\build.spec"
if errorlevel 1 (
echo:
echo PyInstaller build failed.
echo:
pause
exit /b 1
)

echo:
echo Build completed successfully.
echo:
pause
17 changes: 12 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,33 @@ if [ ! -d "$dirpath/env" ]; then
exit 1
fi

# Check if pyinstaller is installed in the virtual environment
# Check if PyInstaller is installed in the virtual environment
if [ ! -f "$dirpath/env/bin/pyinstaller" ]; then
echo
echo "Installing pyinstaller..."
echo "Installing PyInstaller..."
"$dirpath/env/bin/pip" install pyinstaller
if [ $? -ne 0 ]; then
echo "Failed to install pyinstaller."
echo
echo "Failed to install PyInstaller."
echo
read -p "Press any key to continue..."
exit 1
fi
fi

# Run pyinstaller with the specified build spec file
# Run PyInstaller with the specified build spec file
echo
echo "Running pyinstaller..."
echo "Running PyInstaller..."
"$dirpath/env/bin/pyinstaller" "$dirpath/build.spec"
if [ $? -ne 0 ]; then
echo
echo "PyInstaller build failed."
echo
read -p "Press any key to continue..."
exit 1
fi

echo
echo "Build completed successfully."
echo
read -p "Press any key to continue..."
8 changes: 5 additions & 3 deletions setup_env.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if "%dirpath:~-1%" == "\" set "dirpath=%dirpath:~0,-1%"
REM Check if git is installed
git --version > nul 2>&1
if %errorlevel% NEQ 0 (
echo:
echo No git executable found in PATH!
echo:
pause
Expand All @@ -31,16 +32,17 @@ REM Activate the virtual environment and install requirements
echo:
echo Installing requirements.txt...
"%dirpath%\env\scripts\python" -m pip install -U pip

"%dirpath%\env\scripts\pip" install wheel

"%dirpath%\env\scripts\pip" install -r "%dirpath%\requirements.txt"
if %errorlevel% NEQ 0 (
echo:
echo Failed to install requirements.
echo:
pause
exit /b 1
)

echo:
echo All done!
echo Environment setup completed successfully.
echo:
pause
8 changes: 5 additions & 3 deletions setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dirpath=$(dirname "$(readlink -f "$0")")

# Check if git is installed
if ! command -v git &> /dev/null; then
echo
echo "No git executable found in PATH!"
echo
read -p "Press any key to continue..."
Expand All @@ -28,16 +29,17 @@ fi
echo
echo "Installing requirements.txt..."
"$dirpath/env/bin/python" -m pip install -U pip

"$dirpath/env/bin/pip" install wheel

"$dirpath/env/bin/pip" install -r "$dirpath/requirements.txt"
if [ $? -ne 0 ]; then
echo
echo "Failed to install requirements."
echo
read -p "Press any key to continue..."
exit 1
fi

echo
echo "All done!"
echo "Environment setup completed successfully."
echo
read -p "Press any key to continue..."

0 comments on commit 792d589

Please sign in to comment.