From cf9fad35142dbe40b8f1afc6bfb9ea22dfeb3ad1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= 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