From 10eace81387f9ad0afefe02545fb3d35ab7de89c Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 9 May 2016 09:18:10 +0200 Subject: [PATCH] ignored non-existing projects Signed-off-by: Roland Haeder --- commit-jprojects.sh | 53 +++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 24 deletions(-) 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 -- 2.39.5