aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-03 10:13:14 +0800
committertypebrook <typebrook@gmail.com>2020-03-03 10:13:14 +0800
commit1cce0e133884bb562b44fa8dc368de6aa91fdb4b (patch)
tree6e0c5a3ce47aae91ba08a5deb5267c783f443f85 /tools
parent8bf54a6e42aa231d730d7241ca1b7b908343cefa (diff)
parent5778c2a4ac992eb5908830677becedf7f34e99d3 (diff)
Merge remote-tracking branch 'origin/dev' into dev
Diffstat (limited to 'tools')
-rw-r--r--tools/install.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/install.sh b/tools/install.sh
new file mode 100644
index 0000000..0eb2c5e
--- /dev/null
+++ b/tools/install.sh
@@ -0,0 +1,26 @@
1#! /usr/bin/env bash
2
3set -e
4
5# Default settings
6SETTING_DIR=${SETTING_DIR:-~/settings}
7REPO=${REPO:-typebrook/settings}
8REMOTE=${REMOTE:-https://github.com/${REPO}.git}
9BRANCH=${BRANCH:-dev}
10RCFILE=${RCFILE:-~/.$(basename $SHELL)rc}
11
12if [ ! -d $SETTING_DIR ]; then
13 git clone --depth=1 --branch "$BRANCH" "$REMOTE" "$SETTING_DIR" || {
14 error "git clone of settings repo failed"
15 exit 1
16 }
17fi
18
19sed -i "/^$/ N; \^# $REPO^, /^$/ d" $RCFILE
20echo "
21# $REPO
22export SETTING_DIR=$SETTING_DIR
23source \$SETTING_DIR/tools/load-settings.sh
24" >> $RCFILE
25
26cd "$SETTING_DIR" && make