aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/install.sh
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2023-02-14 13:33:23 +0800
committerHsieh Chin Fan <pham@topo.tw>2023-02-14 13:33:23 +0800
commit6fae25b305d714b3ab7608fa003f1af9bf024545 (patch)
tree05507b2c0505659d2fd847ecce988dacab63a236 /tools/install.sh
parent41ad31a2dee9ff912f222652f022b4c55cddcbf7 (diff)
Rename tools into bin
Diffstat (limited to 'tools/install.sh')
-rwxr-xr-xtools/install.sh30
1 files changed, 0 insertions, 30 deletions
diff --git a/tools/install.sh b/tools/install.sh
deleted file mode 100755
index 1f1dd86..0000000
--- a/tools/install.sh
+++ /dev/null
@@ -1,30 +0,0 @@
1#! /usr/bin/env bash
2
3set -e
4
5# Default settings
6SETTING_DIR=${SETTING_DIR:-~/helper}
7REPO=${REPO:-typebrook/helper}
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 helper repo failed"
15 exit 1
16 }
17fi
18
19# Write initial commands into .bashrc or .zshrc
20sed -i'.bak' "\^# $REPO^, /^$/ d" $RCFILE
21cat >>$RCFILE <<EOF
22
23# $REPO
24export SETTING_DIR=$SETTING_DIR
25source \$SETTING_DIR/tools/init/load-settings.sh
26EOF
27
28cd "$SETTING_DIR" || exit 1
29git swapprotocol
30make