X-Git-Url: https://git.mxchange.org/?p=jprojects-scripts.git;a=blobdiff_plain;f=commit-jprojects.sh;h=deff10f8ae75d514bac79c52a56b76e867e778fe;hp=86810644ffa558d9fe0dfa3a9b1a079a717b3e75;hb=97c1c6379668a0d22905551988e4876163f4438c;hpb=ea626de0fe422e33d641f108b0a940bbfc0afcc3 diff --git a/commit-jprojects.sh b/commit-jprojects.sh index 8681064..deff10f 100755 --- a/commit-jprojects.sh +++ b/commit-jprojects.sh @@ -3,21 +3,36 @@ . ./.jprojects.sh || exit 255 for project in ${LIST}; do - if [ ! -d "${JPROJECTS_HOME}/${project}" ] + if [ "${project}" = "jprojects-scripts" ] then + echo "$0: Skipping jprojects-scripts ..." + continue + elif [ ! -d "${JPROJECTS_HOME}/${project}" ] + then + echo "$0: Project '${project}' does not exist." continue fi cd "${JPROJECTS_HOME}/${project}" || exit 255 - CHECK_CHANGES=`git commit -a --dry-run | grep "Changes to be committed:"` + CHECK_CHANGES=$(git commit -a --dry-run | grep "Changes to be committed:") if [ -n "${CHECK_CHANGES}" ] then echo "$0: Committing '${project}' ..." - if [ -n "$1" ] + if [ "$1" = "updated jar(s)" ] + then + # Special commit ... (known-binaries) + git commit --signoff -S lib/*.jar -m "$1" + elif [ -n "$1" -a -n "$2" ] + then + # Regular commit with given message + git commit $2 --signoff -S -m "$1" || exit 255 + elif [ -n "$1" ] then + # Regular commit with given message git commit -a --signoff -S -m "$1" || exit 255 else + # Regular commit, will open $EDITOR for commit message git commit -a --signoff -S || exit 255 fi else