diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | alias | 1 | ||||
-rw-r--r-- | tools/install.sh | 26 |
4 files changed, 37 insertions, 1 deletions
@@ -26,7 +26,7 @@ tig: | |||
26 | wiki: | 26 | wiki: |
27 | # vimwiki | 27 | # vimwiki |
28 | if [ ! -d "$(HOME)/.vimwiki" ]; then \ | 28 | if [ ! -d "$(HOME)/.vimwiki" ]; then \ |
29 | git clone --depth=1 git@github.com:typebrook/wiki.git ~/vimwiki; \ | 29 | git clone --depth=1 git@github.com:typebrook/wiki.git ~/vimwiki |
30 | fi | 30 | fi |
31 | 31 | ||
32 | crontab: | 32 | crontab: |
diff --git a/README.md b/README.md new file mode 100644 index 0000000..c77e1c3 --- /dev/null +++ b/README.md | |||
@@ -0,0 +1,9 @@ | |||
1 | ## Getting Started | ||
2 | **via curl** | ||
3 | ``` | ||
4 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/typebrook/settings/dev/tools/install.sh)" | ||
5 | ``` | ||
6 | **via wget** | ||
7 | ``` | ||
8 | sh -c "$(wget -O- https://raw.githubusercontent.com/typebrook/settings/dev/tools/install.sh)" | ||
9 | ``` | ||
@@ -270,6 +270,7 @@ alias and='cd ~/git/geoBingAn.Android' | |||
270 | alias cdT='cd ~/git/taiwan-topo' | 270 | alias cdT='cd ~/git/taiwan-topo' |
271 | alias cdand='cd ~/git/sample' | 271 | alias cdand='cd ~/git/sample' |
272 | alias cdm='cd ~/git/tilemaker' | 272 | alias cdm='cd ~/git/tilemaker' |
273 | alias stew='cd ~/git/mapstew' | ||
273 | 274 | ||
274 | TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305' | 275 | TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305' |
275 | TAIWAN_BBOX_V='20.72799,118.1036,26.60305,122.9312' | 276 | TAIWAN_BBOX_V='20.72799,118.1036,26.60305,122.9312' |
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 | |||
3 | set -e | ||
4 | |||
5 | # Default settings | ||
6 | SETTING_DIR=${SETTING_DIR:-~/settings} | ||
7 | REPO=${REPO:-typebrook/settings} | ||
8 | REMOTE=${REMOTE:-https://github.com/${REPO}.git} | ||
9 | BRANCH=${BRANCH:-dev} | ||
10 | RCFILE=${RCFILE:-~/.$(basename $SHELL)rc} | ||
11 | |||
12 | if [ ! -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 | } | ||
17 | fi | ||
18 | |||
19 | sed -i "/^$/ N; \^# $REPO^, /^$/ d" $RCFILE | ||
20 | echo " | ||
21 | # $REPO | ||
22 | export SETTING_DIR=$SETTING_DIR | ||
23 | source \$SETTING_DIR/tools/load-settings.sh | ||
24 | " >> $RCFILE | ||
25 | |||
26 | cd "$SETTING_DIR" && make | ||