-
Notifications
You must be signed in to change notification settings - Fork 8
/
UPDATE_THE_PROJECT.bat
50 lines (40 loc) · 1.08 KB
/
UPDATE_THE_PROJECT.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
where /q python3
if errorlevel 1 (
echo Cannot find the 'python3' program.
echo Make sure you have it installed.
pause
exit /b
) else (
echo Found Python
call python3 --version
)
echo Setting things up ...
echo (this can take a while the first time)
call python3 -m pip install poetry
set POETRY=call python3 -m poetry
set BASEDIR="%~dp0"
echo Base Directory is %BASEDIR%
cd %BASEDIR%
%POETRY% install
set TOOLS=%POETRY% run -- python -m cyoa.tools.client
if "%~1"=="" (
echo ERROR: No file provided!
echo Drag a file on the script
pause
exit /b
)
set INPUT="%~1"
set VERSION=v17
set VIEWER=viewer-beta
set PROJECT="project-%VERSION%.json"
echo Copying %INPUT% to %PROJECT%
call copy %INPUT% %BASEDIR%\%PROJECT%
%TOOLS% project.format --project %PROJECT% --skip-backup
%TOOLS% media.optimize --project %PROJECT% --write
%TOOLS% project.patch --project %PROJECT% ^
--patch cyoa.patch:FixScoreLabels ^
cyoa.patch:FixConditionLabels ^
cyoa.patch:FixMultiSelectCounters
%TOOLS% build --input %PROJECT% --output %VIEWER%
pause