diff options
| -rw-r--r-- | scripts/check_upstream.sh (renamed from script/sync.sh) | 7 | ||||
| -rw-r--r-- | scripts/sync-vimwiki.cron (renamed from script/sync-vimwiki.cron) | 0 | ||||
| -rwxr-xr-x | scripts/sync.sh | 9 |
3 files changed, 11 insertions, 5 deletions
diff --git a/script/sync.sh b/scripts/check_upstream.sh index a555869..888061e 100644 --- a/script/sync.sh +++ b/scripts/check_upstream.sh | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | # check git repo $1 if upstream branch | ||
| 2 | # origin/master is ahead of local branch $2(default to dev) | ||
| 1 | check_upstream() { | 3 | check_upstream() { |
| 2 | 4 | ||
| 3 | head='dev' | 5 | head='dev' |
| @@ -15,8 +17,3 @@ check_upstream() { | |||
| 15 | echo "New commit at" $1 | 17 | echo "New commit at" $1 |
| 16 | fi | 18 | fi |
| 17 | } | 19 | } |
| 18 | |||
| 19 | cd ~/git/settings && git pull --quiet & | ||
| 20 | cd ~/vimwiki && git pull --quiet & | ||
| 21 | check_upstream git/tig & | ||
| 22 | check_upstream .vim_runtime & | ||
diff --git a/script/sync-vimwiki.cron b/scripts/sync-vimwiki.cron index c99487f..c99487f 100644 --- a/script/sync-vimwiki.cron +++ b/scripts/sync-vimwiki.cron | |||
diff --git a/scripts/sync.sh b/scripts/sync.sh new file mode 100755 index 0000000..26abc22 --- /dev/null +++ b/scripts/sync.sh | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | DIR="$(cd "$(dirname "$0")" && pwd)" | ||
| 4 | source $DIR/check_upstream.sh | ||
| 5 | |||
| 6 | cd ~/git/settings && git pull --quiet & | ||
| 7 | cd ~/vimwiki && git pull --quiet & | ||
| 8 | check_upstream git/tig & | ||
| 9 | check_upstream .vim_runtime & | ||