summaryrefslogtreecommitdiffstats
path: root/bashrc
diff options
context:
space:
mode:
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc/main.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/bashrc/main.sh b/bashrc/main.sh
index ad922d4..4a6d48a 100644
--- a/bashrc/main.sh
+++ b/bashrc/main.sh
@@ -13,10 +13,11 @@ declare -r _BASHRC_DIR="${_DOTFILES_DIR}/bashrc"
_self_update() {
pushd ${_DOTFILES_DIR} &>/dev/null
- if [[ -n "$(git fetch 2>&1)" && $? -eq 0 ]]; then
- echo -ne "\033[31m*\033[0m dotfile updates found, merge now? "
-
- if read; then
+ git fetch orgin 2>/dev/null
+ if [[ -n "$(git whatchanged HEAD..origin/master)" ]]; then
+ echo -ne "\033[31m*\033[0m dotfile updates found, merge now? (Y/n) "
+ read _merge;
+ if [[ $_merge != 'n' ]]; then
git merge origin/master
if [[ -e management/symlinks.md5 ]]; then