From b8c54d1f1bed345168b17a442dfd91fb68f29dd8 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 7 Apr 2009 20:28:27 +0200 Subject: update-magic improved Conflicts: bashrc/main.sh --- bashrc/main.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bashrc') 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 -- cgit v1.2.3