From 04ac2a7f7bd27393c5dfd3384d3dd6cb227a4198 Mon Sep 17 00:00:00 2001 From: Greg Turnquist Date: Tue, 7 Jul 2015 13:04:24 -0500 Subject: [PATCH] #184 - Improvements to new issue branch script Removed the offline mode for the issue branch. If dependencies are missing it won't work offline either. Rename it to drop the .sh suffix. That way, we can change its language in the future without user having to know. Original pull request: #185. --- .gitignore | 1 + .../{new-issue-branch.sh => new-issue-branch} | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) rename etc/scripts/{new-issue-branch.sh => new-issue-branch} (67%) diff --git a/.gitignore b/.gitignore index 5fbc110c..a17c04e3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ target .settings/ .project .classpath +.idea diff --git a/etc/scripts/new-issue-branch.sh b/etc/scripts/new-issue-branch similarity index 67% rename from etc/scripts/new-issue-branch.sh rename to etc/scripts/new-issue-branch index 6bc1bde0..323dcc51 100755 --- a/etc/scripts/new-issue-branch.sh +++ b/etc/scripts/new-issue-branch @@ -2,12 +2,16 @@ # # This script creates a new local issue branch for the given issue id. # Previous changes are stashed before the issue branch is created and are reapplied after branch creation. -# -# executing new-issue-branch.sh DATACMNS-42 +# +# executing new-issue-branch.sh DATACMNS-42 # will create a new (local) branch issue/DATACMNS-42 +USAGE="$0 " +if [ $# -lt 1 ]; then echo -e "ERROR: ticket_id required. \n$USAGE" >&2; exit 1; fi +if [ $# -gt 1 ]; then echo -e "ERROR: One argument maximum.\n$USAGE" >&2; exit 1; fi TICKET_ID=${1:?"TICKET_ID Parameter is missing!"} -OLD_VERSION_TMP=$(mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '^\[.*') + +OLD_VERSION_TMP=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '^\[.*') OLD_POM_VERSION=${OLD_VERSION_TMP:?"Could not extract current project version from pom.xml"} @@ -19,7 +23,7 @@ echo "Creating feature branch $TICKET_ID: $OLD_POM_VERSION -> $NEW_POM_VERSION" echo "Stashing potential intermediate changes..." && git stash\ && git checkout -b $ISSUE_BRANCH\ -&& mvn -o -q versions:set -DgenerateBackupPoms=false -DnewVersion=$NEW_POM_VERSION\ +&& $(mvn $MAVEN_FLAGS -q versions:set -DgenerateBackupPoms=false -DnewVersion=$NEW_POM_VERSION)\ && ( \ (\ git commit -am "$TICKET_ID - Prepare branch"\