Allow deleting of branches before anything is pulled
[jprojects-scripts.git] / commit-jprojects.sh
index 93783cf..8681064 100755 (executable)
@@ -3,8 +3,13 @@
 . ./.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 [ ! -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
@@ -18,7 +23,6 @@ for project in ${LIST}; do
        else
                echo "$0: Nothing to commit for project '${project}'."
        fi
-       cd -
 done
 
 echo "$0: All done."