-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.sh
64 lines (49 loc) · 1.47 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
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
echo 'Create folders'
mkdir -p out/
mkdir -p cache_template/
echo 'Clean previous output'
rm -r out/
echo 'Create folder in out path'
mkdir -p out/KCCacheProxy/
echo 'Update cache_template cache'
cd cache_template
node ../src/proxy/preload
cd ..
echo 'Compile old js version'
pkg --out-path out src/proxy/proxy.js
echo 'Copy some common files to out path'
cp -r cache_template/* out/KCCacheProxy/
cd out
# Make linux package
cp -r KCCacheProxy/ KCCacheProxy-linux/ &&
mv proxy-linux KCCacheProxy-linux/proxy-linux &&
7z a KCCacheProxy-linux.zip KCCacheProxy-linux &&
rm -r KCCacheProxy-linux &
# Make macos package
cp -r KCCacheProxy/ KCCacheProxy-macos/ &&
mv proxy-macos KCCacheProxy-macos/proxy-macos &&
7z a KCCacheProxy-macos.zip KCCacheProxy-macos &&
rm -r KCCacheProxy-macos &
# Make windows package
cp -r KCCacheProxy/ KCCacheProxy-win/ &&
mv proxy-win.exe KCCacheProxy-win/proxy-win.exe &&
7z a KCCacheProxy-win.zip KCCacheProxy-win &&
rm -r KCCacheProxy-win &
# Make minimum cache package
cp -r KCCacheProxy/cache/ minimum-cache/ &&
7z a minimum-cache.zip minimum-cache &&
rm -r minimum-cache &
wait
cp minimum-cache.zip ../minimum-cache.zip
echo 'Make x64 & ia32 electron build'
npm run-script make -- --arch x64
npm run-script make -- --arch ia32
for i in ./make/squirrel.windows/*/*.exe ; do
p="${i/.\/make\/squirrel.windows\//}"
arch="${p/\/KC*/}"
file=${p/\.exe/}
cp "${i}" "./${file/*\//}-${arch}.exe"
done
echo 'Cleanup...'
rm -r KCCacheProxy*/
rm -r make