forked from toolkit-for-ynab/toolkit-for-ynab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·40 lines (32 loc) · 1.31 KB
/
build
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
#!/usr/bin/env bash
set -e
# Populate feature files like feed changes by reading thorugh the code and hooking up
# all the calls we need, as well as processing settings files
python populateFeaturesFiles.py
# Check our code style with jscs.
echo "[ INFO] Checking code style with ESLint..."
npm run eslint --silent || exit
# Transpile the source/ directory, putting the files in src/ which is where Kango expects to see them.
echo "[ INFO] Transpiling code with Babel on ES2015 preset..."
rm -rf src
npm run babel --silent || exit
# Copy any non JS files across that babel didn't bring with it. Ignore existing files we just transpiled.
rsync -r --ignore-existing source/* src/
# Run the Kango build.
if hash python2 2>/dev/null; then
python2 lib/kango-framework-latest/kango.py build .
elif hash python2.7 2>/dev/null; then
python2.7 lib/kango-framework-latest/kango.py build .
else
python lib/kango-framework-latest/kango.py build .
fi
# The safari icon needs to be different than the other browsers. Move it into place.
echo "[ INFO] Moving Safari extension icons into place..."
pushd output/safari/*.safariextension/icons > /dev/null
rm -f button.png
mv button-safari.png button.png
cp ../../../../src/common/icons/button-safari@2x.png button@2x.png
rm button-safari@2x.png
popd > /dev/null
# Clean up.
rm -rf src