Jepp, no more these projects
[jprojects-scripts.git] / checkout-jprojects.sh
1 #!/bin/bash
2
3 . ./.jprojects.sh || exit 255
4
5 TARGET_BRANCH="master"
6
7 for project in ${LIST}; do
8         if [ "${project}" = "jprojects-scripts" ]
9         then
10                 echo "$0: Skipping jprojects-scripts ..."
11                 continue
12         elif [ ! -d "${JPROJECTS_HOME}/${project}" ]
13         then
14                 echo "$0: Project '${project}' does not exist."
15                 continue
16         fi
17
18         echo "$0: Processing '${project}' ..."
19         cd "${JPROJECTS_HOME}/${project}"
20
21         # Checkout all
22         git checkout -- .
23
24         if [ -n "${TARGET_BRANCH}" ]
25         then
26                 echo "$0: Switching back to '${TARGET_BRANCH}'"
27                 git checkout "${TARGET_BRANCH}"
28         fi
29 done
30
31 echo "$0: All done."
32 exit 0