-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_portable.bat
50 lines (35 loc) · 967 Bytes
/
build_portable.bat
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
46
47
48
49
50
@echo off
REM DO NOT USE THIS SCRIPT. It is for creating new releases.
set RELEASEDIRNAME="__release__"
set ORIGDIR="%CD%"
set SCRIPTDIR="%~dp0"
cd %SCRIPTDIR%
set BUILDDIR="%SCRIPTDIR%\build"
set DISTDIR="%SCRIPTDIR%\dist"
set RELEASEDIR="%SCRIPTDIR%\%RELEASEDIRNAME%"
del /f /s /q "%BUILDDIR%" 1>nul 2>&1
rmdir /s /q "%BUILDDIR%" 1>nul 2>&1
del /f /s /q "%DISTDIR%" 1>nul 2>&1
rmdir /s /q "%DISTDIR%" 1>nul 2>&1
del /f /s /q "%RELEASEDIR%" 1>nul 2>&1
rmdir /s /q "%RELEASEDIR%" 1>nul 2>&1
echo Building portable EXE...
call conda run -n bookdir2pdf_build pyinstaller ^
--noconfirm ^
--onefile ^
--icon=icon.ico ^
bookdir2pdf.py
if errorlevel 1 goto ERROR
del /f /s /q "%BUILDDIR%" 1>nul 2>&1
rmdir /s /q "%BUILDDIR%" 1>nul 2>&1
rename "%DISTDIR%" "%RELEASEDIRNAME%" 1>nul 2>&1
if errorlevel 1 goto ERROR
goto DONE
:ERROR
cd %ORIGDIR%
echo Portable EXE build failed!
exit /B 1
:DONE
cd %ORIGDIR%
echo Portable EXE build done!
exit /B 0