-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildProject.bat
62 lines (52 loc) · 1.68 KB
/
BuildProject.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
51
52
53
54
55
56
57
58
59
60
61
62
@echo off
@title -- Build Tool --
cls
echo ////////////////////////////////////////////////////////////////////
echo Titimousse Project Building Tool
echo --- Building: DesktopMeMer ---
echo ////////////////////////////////////////////////////////////////////
rem Ask user to confirm and start the build
echo The build will begin. Press any key to continue...
pause >nul
rem Move to the source directory
cd /d "%~dp0src" || (
echo Error: Could not find the source directory. Exiting...
exit /b 1
)
rem Create a .zip of the source files
echo Creating the app.nw archive...
..\TSdk\7z a -tzip ..\Output\app.nw * -r || (
echo Error: Failed to create app.nw. Exiting...
exit /b 1
)
rem Move back to the root project directory
cd /d "%~dp0" || (
echo Error: Failed to return to the root directory. Exiting...
exit /b 1
)
rem Copy node_modules to the Output directory
echo Copying node_modules...
xcopy /i /e /h /y src\node_modules Output\node_modules || (
echo Error: Failed to copy node_modules. Exiting...
exit /b 1
)
rem Move to the Output directory
cd /d "%~dp0Output" || (
echo Error: Could not find the Output directory. Exiting...
exit /b 1
)
rem Combine nw.exe and app.nw to create app.exe
echo Combining nw.exe and app.nw to create app.exe...
copy /b nw.exe+app.nw app.exe || (
echo Error: Failed to combine nw.exe and app.nw. Exiting...
exit /b 1
)
rem Rename nw.exe to cleanNW.old_exe
echo Renaming nw.exe to cleanNW.old_exe...
ren nw.exe cleanNW.old_exe || (
echo Error: Failed to rename nw.exe. Exiting...
exit /b 1
)
rem Project setup completed
echo Project Setup Completed.
pause >nul