forked from sharkdp/insect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·31 lines (27 loc) · 1.23 KB
/
build.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
#!/bin/bash
npm run browserify
cp insect.js web/
cp bower_components/keyboardevent-key-polyfill/index.js web/keyboardevent-key-polyfill.js
cp bower_components/jquery.terminal/js/jquery.terminal-1.6.3.min.js web/jquery.terminal.min.js
cp bower_components/jquery/dist/jquery.min.js web/
cp bower_components/jquery.terminal/js/jquery.mousewheel-min.js web/
if [[ $* == *--nexe* ]]
then
echo "Compiling binaries into ./binaries/"
# Make a directory to hold the binaries. This should not be checked in to version control.
mkdir binaries
# Remove the shebang from index.js.
tail -n +2 index.js > temp.js
# We will target windows, mac, and linux.
# Notice that a nexe build target string takes the form
# platform-architecture-node_version.
# If we want to bump the node version we are using,
# we need to change these lines.
nexe temp.js -t linux-x64-8.8.1 -o ./binaries/insect-linux-x64
nexe temp.js -t linux-x86-8.8.1 -o ./binaries/insect-linux-x86
nexe temp.js -t mac-x64-8.8.1 -o ./binaries/insect-mac
nexe temp.js -t windows-x64-8.8.1 -o ./binaries/insect-windows-x64.exe
nexe temp.js -t windows-x86-8.8.1 -o ./binaries/insect-windows-x86.exe
rm temp.js
echo "Done compiling binaries."
fi