From 3f5456e52c017a768b0b8c28c529f5cb945c23b1 Mon Sep 17 00:00:00 2001 From: p4bl0 Date: Sat, 24 Jul 2010 19:47:31 +0200 Subject: check for existing git repos before install. abort if one exists to avoid overriding files --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'install.sh') diff --git a/install.sh b/install.sh index a24f3c3..7cd45a2 100644 --- a/install.sh +++ b/install.sh @@ -28,6 +28,10 @@ fugitive_install() { if [ "$1" != "" ]; then DIR="$1"; fi if [ ! -d "$DIR" ]; then mkdir -p "$DIR"; fi cd "$DIR" + if [ -d ".git" ]; then + echo "There's already a git repository here, aborting install." + exit 1 + fi echo -n "Creating new git repository... " git init >/dev/null echo "done." -- cgit v1.2.3