From: Roland Haeder Date: Mon, 9 May 2016 07:18:10 +0000 (+0200) Subject: ignored non-existing projects X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=10eace81387f9ad0afefe02545fb3d35ab7de89c;p=jprojects-scripts.git ignored non-existing projects Signed-off-by: Roland Haeder --- diff --git a/commit-jprojects.sh b/commit-jprojects.sh index 68fdbee..31bac12 100755 --- a/commit-jprojects.sh +++ b/commit-jprojects.sh @@ -1,24 +1,29 @@ -#!/bin/bash - -. ./.jprojects.sh || exit 255 - -for project in ${LIST}; do - cd "${JPROJECTS_HOME}/${project}" || exit 255 - CHECK_CHANGES=`git commit -a --dry-run | grep "Changes to be committed:"` - - if [ -n "${CHECK_CHANGES}" ] - then - echo "$0: Committing '${project}' ..." - if [ -n "$1" ] - then - git commit -a --signoff -S -m "$1" || exit 255 - else - git commit -a --signoff -S || exit 255 - fi - else - echo "$0: Nothing to commit for project '${project}'." - fi -done - -echo "$0: All done." -exit 0 +#!/bin/bash + +. ./.jprojects.sh || exit 255 + +for project in ${LIST}; do + if [ ! -d "${JPROJECTS_HOME}/${project}" ] + then + continue + fi + + cd "${JPROJECTS_HOME}/${project}" || exit 255 + CHECK_CHANGES=`git commit -a --dry-run | grep "Changes to be committed:"` + + if [ -n "${CHECK_CHANGES}" ] + then + echo "$0: Committing '${project}' ..." + if [ -n "$1" ] + then + git commit -a --signoff -S -m "$1" || exit 255 + else + git commit -a --signoff -S || exit 255 + fi + else + echo "$0: Nothing to commit for project '${project}'." + fi +done + +echo "$0: All done." +exit 0