From ce7f6d6e5287fade16c41c7a18dd3a2043928efe Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Fri, 28 Oct 2016 09:08:54 +0800 Subject: [PATCH] Also run git gc after nvm upgraded --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index 676ba3d..253354b 100755 --- a/install.sh +++ b/install.sh @@ -74,6 +74,10 @@ install_nvm_from_git() { echo >&2 "Failed to update nvm, run 'git fetch' in $INSTALL_DIR yourself." exit 1 } + echo "=> Compressing and cleaning up git repository" + if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" gc --aggressive --prune=now ; then + echo >&2 "Your version of git is out of date. Please update it!" + fi else # Cloning to $INSTALL_DIR echo "=> Downloading nvm from git to '$INSTALL_DIR'"