aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--README.md9
-rw-r--r--alias1
-rw-r--r--tools/install.sh26
4 files changed, 37 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index fcd6c5d..95daccb 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ tig:
26wiki: 26wiki:
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
32crontab: 32crontab:
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```
4sh -c "$(curl -fsSL https://raw.githubusercontent.com/typebrook/settings/dev/tools/install.sh)"
5```
6**via wget**
7```
8sh -c "$(wget -O- https://raw.githubusercontent.com/typebrook/settings/dev/tools/install.sh)"
9```
diff --git a/alias b/alias
index 053628e..f22f1c2 100644
--- a/alias
+++ b/alias
@@ -270,6 +270,7 @@ alias and='cd ~/git/geoBingAn.Android'
270alias cdT='cd ~/git/taiwan-topo' 270alias cdT='cd ~/git/taiwan-topo'
271alias cdand='cd ~/git/sample' 271alias cdand='cd ~/git/sample'
272alias cdm='cd ~/git/tilemaker' 272alias cdm='cd ~/git/tilemaker'
273alias stew='cd ~/git/mapstew'
273 274
274TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305' 275TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305'
275TAIWAN_BBOX_V='20.72799,118.1036,26.60305,122.9312' 276TAIWAN_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
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