From: Nicolas Boisselier Date: Fri, 21 Aug 2015 16:31:28 +0000 (+0100) Subject: git_create X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=f7f73acc69cfbb687778fb9d9128a58f7e9e3e87;p=nb.git git_create --- diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index 20dcba22..f807827e 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -17,7 +17,7 @@ GIT_CREATE_REPO='git@git.nbdom.net' git_create() { shell_help_noarg "Usage: $FUNCNAME DIRECTORY" "$@" && return 1 declare dir="$1"; shift - declare name="${dir}.git" +# NB 21.08.15 declare name="${dir}.git" # NB 30.07.15 declare name="${1%.git}" # NB 30.07.15 declare dir=$(basename $name) declare repo="$GIT_CREATE_REPO" @@ -28,18 +28,18 @@ git_create() { # [ -e "$dir" ] && echo ">$dir already exists!" 1>&2 && return 1 - echo ">git init --bare ${name}.git" - ssh $repo "git init --bare ${name}.git" || return + echo ">git init --bare ${dir}.git" + ssh $repo "git init --bare ${dir}.git" || return - echo ">git clone ${repo}:${name}.git" - git clone ${repo}:${name}.git || return + echo ">git clone ${repo}:${dir}.git" + git clone ${repo}:${dir}.git || return echo ">git init [$dir]" cd $dir || return git init # Create files - printf "$name\n=============\n\n\n## Synopsis\n\nDESCRIPTION\n" > README.md + printf "$dir\n=============\n\n\n## Synopsis\n\nDESCRIPTION\n" > README.md echo ">git add ." git add . @@ -48,8 +48,8 @@ git_create() { git commit -m "Created by $FUNCNAME" #git push --set-upstream origin master - echo ">git remote add origin $repo:${name}.git" - git remote add origin $repo:${name}.git + echo ">git remote add origin $repo:${dir}.git" + git remote add origin $repo:${dir}.git } git_clone() {