From 7e79c11320504f0865e0db72591ba2b226102d80 Mon Sep 17 00:00:00 2001 From: shashanka Date: Mon, 27 Jul 2015 18:22:26 +0530 Subject: [PATCH] https://github.com/janl/mustache.js/issues/462 :v: colorified https://github.com/janl/mustache.js/issues/462 :v: Add empty line between variables and loop, Change "executing" to "Installing", Add new line at the end of the last echo https://github.com/janl/mustache.js/issues/462 :v: Removed trailing \n, echo changed for if https://github.com/janl/mustache.js/issues/462 :v: added the word backup into the text. https://github.com/janl/mustache.js/issues/462 Modified echo text https://github.com/janl/mustache.js/issues/462 --- hooks/install-hooks.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hooks/install-hooks.sh b/hooks/install-hooks.sh index 577dcb7..422d24d 100755 --- a/hooks/install-hooks.sh +++ b/hooks/install-hooks.sh @@ -3,14 +3,20 @@ HOOK_NAMES="pre-commit" HOOK_DIR=$(git rev-parse --show-toplevel)/.git/hooks INSTALL_DIR=$(git rev-parse --show-toplevel)/hooks +COLOR_GREEN=`tput setaf 2` +COLOR_RESET=`tput sgr0` for hook in $HOOK_NAMES; do + echo -n "Installing $hook hook..." # If the hook already exists, is executable, and is not a symlink if [ ! -h $HOOK_DIR/$hook -a -x $HOOK_DIR/$hook ]; then + echo -n " Hook already exists, saving old hook backup at $HOOK_DIR/$hook.local..." mv $HOOK_DIR/$hook $HOOK_DIR/$hook.local fi # create the symlink, overwriting the file if it exists # probably the only way this would happen is if you're using an old version of git # -- back when the sample hooks were not executable, instead of being named ____.sample + echo -n " Creating symlink..." ln -s -f $INSTALL_DIR/$hook $HOOK_DIR + echo "${COLOR_GREEN} Done! ✓${COLOR_RESET}" done \ No newline at end of file