Skip to content

Commit 29eb7b6

Browse files
committed
adding set -e error handling
1 parent e784f1c commit 29eb7b6

7 files changed

+21
-0
lines changed

g-apply-patch

100644100755
+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# You must supply this script with a .patch file as the first argument
55
#
66

7+
# exit script on first error
8+
set -e
9+
710
if [ -f "$1" ]
811
then
912
FEATURE_NAME=`basename -s .patch $1`

g-branch

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Creates a git branch, aka a feature branch
44
# Prior to branching we're rebasing from SVN trunk which requires a clean master
55

6+
# exit script on first error
7+
set -e
8+
69
if [ $# -eq 0 ]
710
then
811
echo "You must supply a branch name"

g-cleanup

100644100755
+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# g-cleanup
33
# Prunes old branches and runs maintenance tasks on the git repository
44

5+
# exit script on first error
6+
set -e
7+
58
DEAD_WOOD=`git branch | grep DELETE | tr '\n,*' ' '`
69

710
read -p "Continue deleting the following branches? (Y/N) [${DEAD_WOOD}] : " APPROVED

g-create-patch

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# Ideally suited for collaborators who do not have commit access to your SVN trunk
55
#
66

7+
# exit script on first error
8+
set -e
9+
710
CURRENT=`git branch | grep '\*' | awk '{print $2}'`
811
CWD=`pwd`
912

g-init

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Initializes a local git repository based on our SVN repository
44
# This is only necessary to run once, all other g-* commands expect this repo
55

6+
# exit script on first error
7+
set -e
8+
69
# Edit to suit
710
SVN_REPO="svn+ssh://your.repo.url.here.com/foo"
811
LOCAL_REPO_NAME="a-clever-name"

g-ship

100644100755
+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# Largely inspired by Rein's "hack && ship" scripts
66
# http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
77

8+
# exit script on first error
9+
set -e
10+
811
CURRENT=`git branch | grep '\*' | awk '{print $2}'`
912
if [ ${CURRENT} == "master" ]
1013
then

g-update

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
88
#
99

10+
# exit script on first error
11+
set -e
12+
1013
CURRENT=`git branch | grep '\*' | awk '{print $2}'`
1114
git checkout master
1215
git svn rebase

0 commit comments

Comments
 (0)