added ability to delete branches
[jprojects-scripts.git] / commit-jprojects.sh
1 #!/bin/bash
2
3 . ./.jprojects.sh || exit 255
4
5 for project in ${LIST}; do
6         if [ ! -d "${JPROJECTS_HOME}/${project}" ]
7         then
8                 continue
9         fi
10
11         cd "${JPROJECTS_HOME}/${project}" || exit 255
12         CHECK_CHANGES=`git commit -a --dry-run | grep "Changes to be committed:"`
13
14         if [ -n "${CHECK_CHANGES}" ]
15         then
16                 echo "$0: Committing '${project}' ..."
17                 if [ -n "$1" ]
18                 then
19                         git commit -a --signoff -S -m "$1" || exit 255
20                 else
21                         git commit -a --signoff -S || exit 255
22                 fi
23         else
24                 echo "$0: Nothing to commit for project '${project}'."
25         fi
26 done
27
28 echo "$0: All done."
29 exit 0