diff --git a/bin/git-setup b/bin/git-setup index 9916c7c..c7a35d7 100755 --- a/bin/git-setup +++ b/bin/git-setup @@ -1,8 +1,16 @@ #!/bin/sh +gitdirexists(){ + if [ -d ".git" ]; then + echo ".git directory already exists, aborting" + exit 1 + fi +} + dir=$(test -z "$*" && echo "." || echo "$*") mkdir -p "$dir" \ && cd "$dir" \ + && gitdirexists \ && git init \ && git add . \ && git commit -m 'Initial commit'