diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2025-07-27 21:03:50 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2025-07-27 21:03:50 +0800 |
| commit | cda0870089c57d9b3859af0e58de0349da559020 (patch) | |
| tree | a1e8c1dac6188439e478378d6b3f540d7f865d2a /bin/install.sh | |
| parent | dfb947732c2c57ff16c6e037f7aeda1844628368 (diff) | |
Update
Diffstat (limited to 'bin/install.sh')
| -rwxr-xr-x | bin/install.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/install.sh b/bin/install.sh index 94f23e5..3cf79d0 100755 --- a/bin/install.sh +++ b/bin/install.sh | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | set -e | 3 | set -e |
| 4 | 4 | ||
| 5 | # Default settings | 5 | # Default settings |
| 6 | SETTING_DIR=${SETTING_DIR:-~/helper} | 6 | HELPER_DIR=${HELPER_DIR:-~/helper} |
| 7 | REPO=${REPO:-typebrook/helper} | 7 | REPO=${REPO:-typebrook/helper} |
| 8 | REMOTE=${REMOTE:-https://github.com/${REPO}.git} | 8 | REMOTE=${REMOTE:-https://github.com/${REPO}.git} |
| 9 | BRANCH=${BRANCH:-dev} | 9 | BRANCH=${BRANCH:-dev} |
| @@ -20,8 +20,8 @@ case "$(basename $SHELL)" in | |||
| 20 | esac | 20 | esac |
| 21 | 21 | ||
| 22 | # If ~/helper doesn't exist, do git clone | 22 | # If ~/helper doesn't exist, do git clone |
| 23 | if [ ! -d $SETTING_DIR ]; then | 23 | if [ ! -d $HELPER_DIR ]; then |
| 24 | git clone --depth=1 --branch "$BRANCH" "$REMOTE" "$SETTING_DIR" || { | 24 | git clone --depth=1 --branch "$BRANCH" "$REMOTE" "$HELPER_DIR" || { |
| 25 | error "git clone of helper repo failed" | 25 | error "git clone of helper repo failed" |
| 26 | exit 1 | 26 | exit 1 |
| 27 | } | 27 | } |
| @@ -32,11 +32,11 @@ sed -i "\^$COMMENT_IN_RCFILE^, /^$/ d" $RCFILE | |||
| 32 | cat >>$RCFILE <<EOF | 32 | cat >>$RCFILE <<EOF |
| 33 | 33 | ||
| 34 | $COMMENT_IN_RCFILE | 34 | $COMMENT_IN_RCFILE |
| 35 | export SETTING_DIR=$SETTING_DIR | 35 | export HELPER_DIR=$HELPER_DIR |
| 36 | source \$SETTING_DIR/$PROFILE | 36 | source \$HELPER_DIR/$PROFILE |
| 37 | 37 | ||
| 38 | EOF | 38 | EOF |
| 39 | 39 | ||
| 40 | echo Add profile into $RCFILE | 40 | echo Add profile into $RCFILE |
| 41 | cd "$SETTING_DIR" || exit 1 | 41 | cd "$HELPER_DIR" || exit 1 |
| 42 | make | 42 | make |