forked from cknadler/vim-anywhere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update
executable file
·40 lines (32 loc) · 920 Bytes
/
update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# Info:
# author: Miroslav Vidovic
# file: update
# created: 18.02.2018.-10:47:14
# version: 1.0
# -----------------------------------------------------------------------------
# Requirements:
# git
# Description:
# Updates vim-anywhere
# -----------------------------------------------------------------------------
# Script:
err() { echo -e "$@" 1>&2; }
main(){
AW_PATH=$HOME/.vim-anywhere
if [ ! -d "$AW_PATH" ]; then
err "vim-anywhere doesn't seem to be installed."
exit 1
fi
# if we are in a git repo, unset env vars
if git rev-parse --git-dir &> /dev/null; then
unset "$(git rev-parse --local-env-vars)" &> /dev/null
fi
pushd "$AW_PATH"
git pull origin master
[ $? -ne 0 ] && exit 1
popd
echo "vim-anywhere has been successfully updated!"
}
main