git-setup: create a directory if the provided one does not exist yet. Additionally, enables the creation of directories with names containing spaces in a more fashion way. Example: 'git setup path/to/repo name'.

Signed-off-by: Tj Holowaychuk <tj@vision-media.ca>
This commit is contained in:
Jonhnny Weslley 2010-11-10 16:26:26 -03:00 committed by Tj Holowaychuk
parent 954f3d5f45
commit b8023be66a

View file

@ -1,7 +1,8 @@
#!/bin/sh
dir=${1-.}
cd $dir \
dir=$(test -z "$*" && echo "." || echo "$*")
mkdir -p "$dir" \
&& cd "$dir" \
&& git init \
&& git add . \
&& git commit -m 'Initial commit'