mirror of
https://git.ludikovsky.name/git/fugitive.git
synced 2024-09-28 14:25:26 +02:00
check for existing git repos before install. abort if one exists to avoid overriding files
This commit is contained in:
parent
d3c10aea88
commit
3f5456e52c
|
@ -28,6 +28,10 @@ fugitive_install() {
|
||||||
if [ "$1" != "" ]; then DIR="$1"; fi
|
if [ "$1" != "" ]; then DIR="$1"; fi
|
||||||
if [ ! -d "$DIR" ]; then mkdir -p "$DIR"; fi
|
if [ ! -d "$DIR" ]; then mkdir -p "$DIR"; fi
|
||||||
cd "$DIR"
|
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... "
|
echo -n "Creating new git repository... "
|
||||||
git init >/dev/null
|
git init >/dev/null
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|
Loading…
Reference in a new issue