forked from webrcade/webrcade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdist.sh
323 lines (269 loc) · 13.3 KB
/
dist.sh
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
DIST="$DIR/dist"
DIST_OUT="$DIST/out"
DIST_OUT_APP="$DIST_OUT/app"
UTILS="$DIR/../webrcade-utils"
#
# Function that is invoked when the script fails.
#
# $1 - The message to display prior to exiting.
#
function fail() {
echo $1
echo "Exiting."
cd $DIR
exit 1
}
##
## create output directories
##
if [ -d "$DIST_OUT" ]; then
rm -r "$DIST_OUT" || { fail 'Error removing dist output directory.'; }
fi
mkdir -p "$DIST_OUT" || { fail 'Error creating dist output directory.'; }
# copy the default feed
node copy-default-feed.js || { fail 'Error copying default feed.'; }
##
## common
##
cd "$DIR/../webrcade-app-common" || { fail 'Unable to change to common.'; }
npm install . || { fail 'Unable to install common dependencies.'; }
npm run build || { fail 'Unable to build common.'; }
npm link || { fail 'Unable to make common linkable.'; }
##
## webrcade
##
cd "$DIR" || { fail 'Unable to change to webrcade.'; }
# dats
cd public || { fail 'Unable to change to public.'; }
mkdir -p "$UTILS" || { fail "Unable to create utils dir"; }
cd "$UTILS" || { fail "Unable to change to utils dir"; }
npm install archiver || { fail 'Unable to install archiver.'; }
wget -O - https://webrcade.github.io/webrcade-utils/roms-scummvm.json > roms-scummvm.json ||
{ fail 'Unable to retrieve scummvm info.'; }
wget -O - https://webrcade.github.io/webrcade-utils/createdats-fbneo.js > createdats-fbneo.js ||
{ fail 'Unable to retrieve create fbneo dats.'; }
wget -O - https://webrcade.github.io/webrcade-utils/createdats.js > createdats.js ||
{ fail 'Unable to retrieve create dats.'; }
cd "$DIR" || { fail 'Unable to change to webrcade.'; }
cd public || { fail 'Unable to change to public.'; }
node "$UTILS/createdats-fbneo.js" || { fail 'Unable to execute create dats fbneo.'; }
cp "roms-fbneo.json" "$UTILS" || { fail 'Unable to copy roms-fbneo.json'; }
node "$UTILS/createdats.js" || { fail 'Unable to execute create dats.'; }
rm -rf "$UTILS" || { fail 'Unable remove utils directory.'; }
cd "$DIR" || { fail 'Unable to change to webrcade.'; }
# build
npm install . || { fail 'Unable to install webrcade dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build webrcade.'; }
cp -R build/. "$DIST_OUT" || { fail 'failed to copy to out.'; }
##
## webrcade-app-snes9x
##
cd "$DIR/../webrcade-app-snes9x" || { fail 'Unable to change to snes9x.'; }
npm install . || { fail 'Unable to install snes9x dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build snes9x.'; }
mkdir -p "$DIST_OUT_APP/snes" || { fail 'Error creating snes output directory.'; }
cp -R build/. "$DIST_OUT_APP/snes" || { fail 'failed to copy snes to out.'; }
##
## webrcade-app-genplusgx
##
cd "$DIR/../webrcade-app-genplusgx" || { fail 'Unable to change to genplusgx.'; }
npm install . || { fail 'Unable to install genplusgx dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build genplusgx.'; }
mkdir -p "$DIST_OUT_APP/genesis" || { fail 'Error creating genesis output directory.'; }
cp -R build/. "$DIST_OUT_APP/genesis" || { fail 'failed to copy genesis to out.'; }
##
## webrcade-app-javatari
##
cd "$DIR/../webrcade-app-javatari" || { fail 'Unable to change to javatari.'; }
npm install . || { fail 'Unable to install javatari dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build javatari.'; }
mkdir -p "$DIST_OUT_APP/2600" || { fail 'Error creating 2600 output directory.'; }
cp -R build/. "$DIST_OUT_APP/2600" || { fail 'failed to copy 2600 to out.'; }
##
## webrcade-app-js7800
##
cd "$DIR/../webrcade-app-js7800" || { fail 'Unable to change to js7800.'; }
npm install . || { fail 'Unable to install js7800 dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build js7800.'; }
mkdir -p "$DIST_OUT_APP/7800" || { fail 'Error creating 7800 output directory.'; }
cp -R build/. "$DIST_OUT_APP/7800" || { fail 'failed to copy 7800 to out.'; }
##
## webrcade-app-fceux
##
cd "$DIR/../webrcade-app-fceux" || { fail 'Unable to change to fceux.'; }
npm install . || { fail 'Unable to install fceux dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build fceux.'; }
mkdir -p "$DIST_OUT_APP/nes" || { fail 'Error creating nes output directory.'; }
cp -R build/. "$DIST_OUT_APP/nes" || { fail 'failed to copy nes to out.'; }
##
## webrcade-app-vba-m
##
cd "$DIR/../webrcade-app-vba-m" || { fail 'Unable to change to vba-m.'; }
npm install . || { fail 'Unable to install vba-m dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build vba-m.'; }
mkdir -p "$DIST_OUT_APP/gba" || { fail 'Error creating gba output directory.'; }
cp -R build/. "$DIST_OUT_APP/gba" || { fail 'failed to copy gba to out.'; }
##
## webrcade-app-mednafen
##
cd "$DIR/../webrcade-app-mednafen" || { fail 'Unable to change to mednafen.'; }
npm install . || { fail 'Unable to install mednafen dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build mednafen.'; }
mkdir -p "$DIST_OUT_APP/mednafen" || { fail 'Error creating mednafen output directory.'; }
cp -R build/. "$DIST_OUT_APP/mednafen" || { fail 'failed to copy mednafen to out.'; }
##
## webrcade-app-parallel-n64
##
cd "$DIR/../webrcade-app-parallel-n64" || { fail 'Unable to change to n64.'; }
npm install . || { fail 'Unable to install n64 dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build n64.'; }
mkdir -p "$DIST_OUT_APP/n64" || { fail 'Error creating n64 output directory.'; }
cp -R build/. "$DIST_OUT_APP/n64" || { fail 'failed to copy n64 to out.'; }
##
## webrcade-app-fbneo
##
cd "$DIR/../webrcade-app-fbneo" || { fail 'Unable to change to fbneo.'; }
npm install . || { fail 'Unable to install fbneo dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build fbneo.'; }
mkdir -p "$DIST_OUT_APP/neo" || { fail 'Error creating fbneo output directory.'; }
cp -R build/. "$DIST_OUT_APP/neo" || { fail 'failed to copy fbneo to out.'; }
##
## webrcade-app-beetle-psx
##
cd "$DIR/../webrcade-app-beetle-psx" || { fail 'Unable to change to beetle-psx.'; }
npm install . || { fail 'Unable to install beetle-psx dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build psx.'; }
mkdir -p "$DIST_OUT_APP/psx" || { fail 'Error creating psx output directory.'; }
cp -R build/. "$DIST_OUT_APP/psx" || { fail 'failed to copy psx to out.'; }
##
## webrcade-app-retro-genplusgx
##
cd "$DIR/../webrcade-app-retro-genplusgx" || { fail 'Unable to change to retro-genplusgx.'; }
npm install . || { fail 'Unable to install retro-genplusgx dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build retro-genplusgx.'; }
mkdir -p "$DIST_OUT_APP/retro-genesis" || { fail 'Error creating retro-genplusgx output directory.'; }
cp -R build/. "$DIST_OUT_APP/retro-genesis" || { fail 'failed to copy retro-genplusgx to out.'; }
##
## webrcade-app-retro-pce-fast
##
cd "$DIR/../webrcade-app-retro-pce-fast" || { fail 'Unable to change to retro-pce-fast.'; }
npm install . || { fail 'Unable to install retro-pce-fast dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build retro-pce-fast.'; }
mkdir -p "$DIST_OUT_APP/retro-pce-fast" || { fail 'Error creating retro-pce-fast output directory.'; }
cp -R build/. "$DIST_OUT_APP/retro-pce-fast" || { fail 'failed to copy retro-pce-fast to out.'; }
##
## webrcade-app-colem
##
cd "$DIR/../webrcade-app-colem" || { fail 'Unable to change to colem.'; }
npm install . || { fail 'Unable to install colem dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build colem.'; }
mkdir -p "$DIST_OUT_APP/colem" || { fail 'Error creating colem output directory.'; }
cp -R build/. "$DIST_OUT_APP/colem" || { fail 'failed to copy colem to out.'; }
##
## webrcade-app-beetle-pcfx
##
cd "$DIR/../webrcade-app-beetle-pcfx" || { fail 'Unable to change to beetle-pcfx.'; }
npm install . || { fail 'Unable to install beetle-pcfx dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build beetle-pcfx.'; }
mkdir -p "$DIST_OUT_APP/pcfx" || { fail 'Error creating beetle-pcfx output directory.'; }
cp -R build/. "$DIST_OUT_APP/pcfx" || { fail 'failed to copy beetle-pcfx to out.'; }
##
## webrcade-app-retro-a5200
##
cd "$DIR/../webrcade-app-retro-a5200" || { fail 'Unable to change to retro-a5200.'; }
npm install . || { fail 'Unable to install retro-a5200 dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build retro-a5200.'; }
mkdir -p "$DIST_OUT_APP/retro-a5200" || { fail 'Error creating retro-a5200 output directory.'; }
cp -R build/. "$DIST_OUT_APP/retro-a5200" || { fail 'failed to copy retro-a5200 to out.'; }
##
## webrcade-app-retro-neocd
##
cd "$DIR/../webrcade-app-retro-neocd" || { fail 'Unable to change to retro-neocd.'; }
npm install . || { fail 'Unable to install retro-neocd dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build retro-neocd.'; }
mkdir -p "$DIST_OUT_APP/retro-neocd" || { fail 'Error creating retro-neocd output directory.'; }
cp -R build/. "$DIST_OUT_APP/retro-neocd" || { fail 'failed to copy retro-neocd to out.'; }
##
## webrcade-app-retro-opera
##
cd "$DIR/../webrcade-app-retro-opera" || { fail 'Unable to change to retro-opera.'; }
npm install . || { fail 'Unable to install retro-opera dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build retro-opera.'; }
mkdir -p "$DIST_OUT_APP/3do" || { fail 'Error creating retro-neocd output directory.'; }
cp -R build/. "$DIST_OUT_APP/3do" || { fail 'failed to copy retro-neocd to out.'; }
##
## webrcade-app-tyrquake
##
cd "$DIR/../webrcade-app-tyrquake" || { fail 'Unable to change to quake.'; }
npm install . || { fail 'Unable to install quake dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build quake.'; }
mkdir -p "$DIST_OUT_APP/quake" || { fail 'Error creating quake output directory.'; }
cp -R build/. "$DIST_OUT_APP/quake" || { fail 'failed to copy quake to out.'; }
##
## webrcade-app-retro-stella-2014
##
cd "$DIR/../webrcade-app-retro-stella-2014" || { fail 'Unable to change to retro stella.'; }
npm install . || { fail 'Unable to install retro stella dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build retro stella.'; }
mkdir -p "$DIST_OUT_APP/retro-stella" || { fail 'Error creating retro stella output directory.'; }
cp -R build/. "$DIST_OUT_APP/retro-stella" || { fail 'failed to copy retro stella to out.'; }
##
## webrcade-app-scummvm
##
cd "$DIR/../webrcade-app-scummvm" || { fail 'Unable to change to scummvm.'; }
npm install . || { fail 'Unable to install scummvm dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build scummvm.'; }
mkdir -p "$DIST_OUT_APP/scummvm" || { fail 'Error creating scummvm output directory.'; }
cp -R build/. "$DIST_OUT_APP/scummvm" || { fail 'failed to copy scummvm to out.'; }
##
## webrcade-app-prboom
##
if test -d "$DIR/../webrcade-app-prboom"; then
cd "$DIR/../webrcade-app-prboom" || { fail 'Unable to change to prboom.'; }
npm install . || { fail 'Unable to install prboom dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build prboom.'; }
mkdir -p "$DIST_OUT_APP/doom" || { fail 'Error creating doom output directory.'; }
cp -R build/. "$DIST_OUT_APP/doom" || { fail 'failed to copy doom to out.'; }
fi
##
## webrcade-editor
##
cd "$DIR/../webrcade-editor" || { fail 'Unable to change to editor.'; }
npm install . || { fail 'Unable to install editor dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build editor.'; }
mkdir -p "$DIST_OUT_APP/editor" || { fail 'Error creating editor output directory.'; }
cp -R build/. "$DIST_OUT_APP/editor" || { fail 'failed to copy editor to out.'; }
##
## webrcade-standalone
##
cd "$DIR/../webrcade-app-standalone" || { fail 'Unable to change to standalone.'; }
npm install . || { fail 'Unable to install standalone dependencies.'; }
npm link "@webrcade/app-common" || { fail 'Unable to link common.'; }
npm run build || { fail 'Unable to build standalone.'; }
mkdir -p "$DIST_OUT_APP/standalone" || { fail 'Error creating standalone output directory.'; }
cp -R build/. "$DIST_OUT_APP/standalone" || { fail 'failed to copy standalone to out.'; }