added jrecruiter for Galdora e.K
[jprojects-scripts.git] / pull-stick.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                 echo "$0: Project '${project}' does not exist."
9                 continue
10         fi
11
12         cd "${JPROJECTS_HOME}/${project}" || exit 255
13
14         if [ "$1" = "c" ]
15         then
16                 echo "$0: Checkout '${project}' ..."
17                 git checkout -- .
18         fi
19
20         SKIP_TEST="${project:0:9}"
21
22         echo "$0: Pulling '${project}' ..."
23         if [ "${SKIP_TEST}" = "jratecalc" ]
24         then
25                 git pull --all || exit 255
26         else
27                 git pull transport master
28                 if [ "$?" != "0" ]
29                 then
30                         git pull --all || exit 255
31                 fi
32         fi
33
34         if [ "$1" != "s" ]
35         then
36                 echo "$0: Rebasing '${project}' ..."
37                 git rebase origin/master || exit 255
38         fi
39 done
40
41 echo "$0: All done."
42 exit 0