diff options
author | p4bl0 <pablo@rauzy.name> | 2010-07-24 19:47:31 +0200 |
---|---|---|
committer | p4bl0 <pablo@rauzy.name> | 2010-07-24 19:47:31 +0200 |
commit | 3f5456e52c017a768b0b8c28c529f5cb945c23b1 (patch) | |
tree | f33c4fe2980f4af7e6a920dc6b44caffa89f6545 | |
parent | d3c10aea8848f38269667f1e4568d52c37ad877c (diff) |
check for existing git repos before install. abort if one exists to avoid overriding files
-rw-r--r-- | install.sh | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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." |