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 | |
| parent | dfb947732c2c57ff16c6e037f7aeda1844628368 (diff) | |
Update
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/init/check_upstream | 2 | ||||
| -rwxr-xr-x | bin/install.sh | 12 | ||||
| -rw-r--r-- | bin/osm/osm | 2 | ||||
| -rwxr-xr-x | bin/wakeup.sh | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/bin/init/check_upstream b/bin/init/check_upstream index fa6d277..529547b 100755 --- a/bin/init/check_upstream +++ b/bin/init/check_upstream | |||
| @@ -21,4 +21,4 @@ if ! git rev-list "$head" | grep "$(git rev-parse origin/master)" > /dev/null; t | |||
| 21 | echo "New commit at" "$1" | 21 | echo "New commit at" "$1" |
| 22 | fi | 22 | fi |
| 23 | 23 | ||
| 24 | echo "$(date)" check "$1" >> "$SETTING_DIR/log" || echo error happens when check upstream at $1 | 24 | echo "$(date)" check "$1" >> "$HELPER_DIR/log" || echo error happens when check upstream at $1 |
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 |
diff --git a/bin/osm/osm b/bin/osm/osm index 344f906..4111eae 100644 --- a/bin/osm/osm +++ b/bin/osm/osm | |||
| @@ -5,7 +5,7 @@ export OSM_SERVER=https://api.openstreetmap.org | |||
| 5 | export OSM_TES_SERVER=https://api.openstreetmap.org | 5 | export OSM_TES_SERVER=https://api.openstreetmap.org |
| 6 | 6 | ||
| 7 | export OSM_API=$OSM_SERVER/api/0.6 | 7 | export OSM_API=$OSM_SERVER/api/0.6 |
| 8 | export OSM_USER_PASSWD=$(cat $SETTING_DIR/tokens/osm 2>/dev/null) | 8 | export OSM_USER_PASSWD=$(cat $HELPER_DIR/tokens/osm 2>/dev/null) |
| 9 | 9 | ||
| 10 | FILENAME=$0 | 10 | FILENAME=$0 |
| 11 | 11 | ||
diff --git a/bin/wakeup.sh b/bin/wakeup.sh index 545511b..cdcaa51 100755 --- a/bin/wakeup.sh +++ b/bin/wakeup.sh | |||
| @@ -2,4 +2,4 @@ | |||
| 2 | 2 | ||
| 3 | date +%s >~/.wakeup | 3 | date +%s >~/.wakeup |
| 4 | 4 | ||
| 5 | find $SETTING_DIR/bin -executable | while read file; do ln -sf $file ~/bin/; done | 5 | find $HELPER_DIR/bin -executable | while read file; do ln -sf $file ~/bin/; done |