1
0
Fork 0
mirror of https://git.ludikovsky.name/git/fugitive.git synced 2024-06-25 03:25:27 +02:00

check for existing git repos before install. abort if one exists to avoid overriding files

This commit is contained in:
p4bl0 2010-07-24 19:47:31 +02:00
parent d3c10aea88
commit 3f5456e52c

View file

@ -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."