-
Notifications
You must be signed in to change notification settings - Fork 3
/
compile.bat
93 lines (74 loc) · 1.65 KB
/
compile.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
SETLOCAL ENABLEDELAYEDEXPANSION
where /q nw
IF ERRORLEVEL 1 (
ECHO nw.js is missing. Ensure it is installed and placed in your PATH.
EXIT /B
)
where /q npm
IF ERRORLEVEL 1 (
ECHO npm is missing. Ensure it is installed and placed in your PATH.
EXIT /B
)
where /q nw-gyp
IF ERRORLEVEL 1 (
ECHO nw-gyp is missing. Ensure it is installed and placed in your PATH.
EXIT /B
)
set "switch=no"
set "python=no"
set "arch=no"
GOTO loop
:loop
IF "[%1]"=="[]" GOTO afterloop
IF "[%1]"=="[--python]" (
set "switch=python"
GOTO Continue
)
IF "[%1]"=="[--arch]" (
set "switch=arch"
GOTO Continue
)
IF "%switch%"=="python" (
set "python=%1"
echo Setting python
GOTO Continue
)
IF "%switch%"=="arch" (
set "arch=%1"
set "TRUE="
IF NOT %arch% == "x64" set TRUE=1
IF NOT %arch% == "ia32" set TRUE=1
IF NOT defined TRUE (
set "string_list = %arch% "is not a valid architecure" "
ECHO %string_list%
ECHO "Valid options are 'ia32' and 'x64'"
EXIT /B
)
)
:Continue
shift
goto loop
:afterloop
echo Done
call npm install
cd ./node_modules/robotjs
set "version="
for /f "delims=" %%a in ('npm show nw version') do @set version=%%a
echo %python%
IF NOT "%arch%"=="no" GOTO archtrue
IF NOT "%python%"=="no" GOTO pytrue
call nw-gyp clean configure build --target=%version%
GOTO end
:archtrue
IF NOT "%python%"=="no" GOTO bothtrue
call nw-gyp clean configure build --target=%version% --arch=%arch%
GOTO end
:pytrue
call nw-gyp clean configure build --target=%version% --python=%python%
GOTO end
:bothtrue
nw-gyp clean configure build --target=%version% --arch=%arch% --python=%python%
GOTO end
:end
echo end
pause