Jepp, no more these projects
[jprojects-scripts.git] / commit-jprojects.sh
index 93783cf..802ea6a 100755 (executable)
@@ -3,8 +3,18 @@
 . ./.jprojects.sh || exit 255
 
 for project in ${LIST}; do
-       cd "${project}" || exit 255
-       CHECK_CHANGES=`git commit --dry-run | grep "Changes to be committed:"`
+       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:"`
 
        if [ -n "${CHECK_CHANGES}" ]
        then
@@ -18,7 +28,6 @@ for project in ${LIST}; do
        else
                echo "$0: Nothing to commit for project '${project}'."
        fi
-       cd -
 done
 
 echo "$0: All done."