forked from LightTable/LightTable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·65 lines (54 loc) · 1.84 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·65 lines (54 loc) · 1.84 KB
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
#!/usr/bin/env bash
set -e
# Build LightTable app and CLI and place in builds/.
# Specify $VERSION to override default build version.
# Pass `--release` to build a release version.
# This script primarily installs dependencies and sets up
# the app before calling build-app.sh to build it.
# Check if lein is installed
[ "`which lein`" ] || { echo >&2 "Please install leiningen before running this script."; exit 1; }
if [ "$(echo `lein version` | grep 'Leiningen \(1.\|2.0\)')" ]; then
echo "lein version must be 2.1 or above. Do a lein upgrade first"; exit 1;
fi
# Check if npm is installed
[ "`which npm`" ] || { echo >&2 "Please install npm before running this script."; exit 1; }
# Ensure we start in project root
cd "$(dirname "${BASH_SOURCE[0]}")"; cd ..
# Ensure we have current version of electron
pushd deploy/electron
npm install
node_modules/.bin/grunt download-electron
popd
# Build the core cljs
# Workaround for #1025 windows bug
if [ "$(echo $(uname -s) | cut -c 1-9)" == "CYGWIN_NT" ]; then
sed -i 's/:source-map/;;:source-map/' project.clj
fi
rm -f deploy/core/node_modules/lighttable/bootstrap.js
lein cljsbuild once app
# Fetch plugins
PLUGINS=("Clojure,0.3.1" "CSS,0.0.6" "HTML,0.1.0" "Javascript,0.2.0"
"Paredit,0.0.4" "Python,0.0.7" "Rainbow,0.0.8")
# Plugins cache
mkdir -p deploy/plugins
pushd deploy/plugins
for plugin in "${PLUGINS[@]}" ; do
NAME="${plugin%%,*}"
VERSION="${plugin##*,}"
if [ -d $NAME ]; then
echo "Updating plugin $NAME $VERSION..."
cd $NAME
git checkout --quiet master
git pull --quiet
git checkout --quiet $VERSION
cd -
else
echo "Cloning plugin $NAME $VERSION..."
git clone "https://github.com/LightTable/$NAME"
cd $NAME
git checkout --quiet $VERSION
cd -
fi
done
popd
script/build-app.sh $@