3dc73ede6f77a919068729e3d2d4df8897f5e39f
[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 || exit 255
28         fi
29
30         echo "$0: Rebasing '${project}' ..."
31         git rebase origin/master || exit 255
32 done