Pull from more repositories
[jprojects-scripts.git] / push-stick.sh
1 #!/bin/bash
2
3 . ./.jprojects.sh || exit 255
4
5 TARGETS="d t u"
6
7 if [ "$1" = "a" ]
8 then
9         cd "${JPROJECTS_HOME}"
10         for TARGET in ${TARGETS}; do
11                 echo "$0: Pushing for target '${TARGET}' ..."
12                 $0 "${TARGET}" "1"
13         done
14
15         echo "$0: Pushed to all targets."
16         exit 0
17 fi
18
19 for project in ${LIST}; do
20         if [ ! -d "${JPROJECTS_HOME}/${project}" ]
21         then
22                 echo "$0: Project '${project}' does not exist."
23                 continue;
24         fi
25
26         echo "$0: Processing '${project}',mode='$1' ..."
27         cd "${JPROJECTS_HOME}/${project}" || exit 255
28
29         if [ "$1" = "d" ]
30         then
31                 git push --all daedalus || exit 255
32         elif [ "$1" = "t" ]
33         then
34                 git push --all transport || exit 255
35         elif [ "$1" = "u" ]
36         then
37                 git push --all upstream || exit 255
38         else
39                 git push --all || exit 255
40         fi
41 done
42
43 echo "$0: All done."
44 exit 0