-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildWindows.cmd
45 lines (35 loc) · 1.19 KB
/
buildWindows.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@echo off
REM Exit the script if any command fails
setlocal enabledelayedexpansion
set "ERRORLEVEL=0"
REM 1. Create a .venv folder in the current folder
echo Creating .venv folder...
if not exist ".venv" mkdir ".venv"
REM 2. Create a Python virtual environment in that .venv folder
echo Creating virtual environment...
python -m venv .venv
REM 3. Activate the virtual environment
echo Activating virtual environment...
call .venv\Scripts\activate.bat
REM 4. Install PyInstaller in that virtual environment
echo Installing PyInstaller...
pip install pyinstaller
REM 5. Run PyInstaller with the specified .spec file
REM To handle prompts automatically, use `yes` if needed
echo Running PyInstaller...
if exist "dist" (
rmdir /S /Q "dist"
)
if exist "build" (
rmdir /S /Q "build"
)
echo Y | pyinstaller mybible-cli.spec
REM 6. Copy 'myfile.cmd' to .\dest\myscript\
echo Copying files to .\dist\mybible-cli\...
copy ".\tools\scripts\clip2bible.cmd" ".\dist\mybible-cli\clip2bible.cmd"
REM Deactivate the virtual environment
echo Deactivating virtual environment...
call .venv\Scripts\deactivate.bat
echo Script completed successfully.
REM Exit with the status of the last command
exit /b %ERRORLEVEL%