From c562e291c0adca7cb7dd2e1ce5ac26e1cd405603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 8 Sep 2012 20:00:33 -0300 Subject: Exit on error --- git-shell-commands/change-description | 2 +- git-shell-commands/create-bare-repo | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'git-shell-commands') diff --git a/git-shell-commands/change-description b/git-shell-commands/change-description index 120b1cd..d29eaa8 100755 --- a/git-shell-commands/change-description +++ b/git-shell-commands/change-description @@ -2,7 +2,7 @@ # Allows users to change project description # $ ssh git@host change-description repo "description" -set -E +set -e repo=$1; shift diff --git a/git-shell-commands/create-bare-repo b/git-shell-commands/create-bare-repo index 14a640b..b0174e2 100755 --- a/git-shell-commands/create-bare-repo +++ b/git-shell-commands/create-bare-repo @@ -2,15 +2,15 @@ # Allows users to create repo.git # $ ssh git@host create-bare-repo repo1 repo2 ... -set -E +set -e for i in $@; do # Cleanup names - i="`echo "$i" | sed "s/[^a-z0-9\.\-\_]//gi"`" + repo="`echo "$i" | sed "s/[^a-z0-9\.\-\_]//gi"`" - if [ -z "$i" ]; then continue; fi + if [ -z "$repo" ]; then continue; fi - mkdir "$i".git - pushd "$i".git + mkdir "$repo".git + pushd "$repo".git git init --bare done -- cgit v1.2.3