From b8023be66aabd3239ae5f4d23339cadb28766637 Mon Sep 17 00:00:00 2001 From: Jonhnny Weslley Date: Wed, 10 Nov 2010 16:26:26 -0300 Subject: [PATCH] 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 --- bin/git-setup | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/git-setup b/bin/git-setup index 5c58462..9916c7c 100755 --- a/bin/git-setup +++ b/bin/git-setup @@ -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'