OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 set_target_os () { | 3 set_target_os () { |
4 # Get the os we're building for. On first run, this will be unset. | 4 # Get the os we're building for. On first run, this will be unset. |
5 target_os=$(git config target.os 2>/dev/null) | 5 target_os=$(git config target.os 2>/dev/null) |
6 if [ -z "$target_os" ]; then | 6 if [ -z "$target_os" ]; then |
7 case $(uname -s) in | 7 case $(uname -s) in |
8 Linux) target_os=unix ;; | 8 Linux) target_os=unix ;; |
9 Darwin) target_os=mac ;; | 9 Darwin) target_os=mac ;; |
10 CYGWIN*|MINGW*) target_os=win ;; | 10 CYGWIN*|MINGW*) target_os=win ;; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 if [ "$solution" = "$1" ]; then | 66 if [ "$solution" = "$1" ]; then |
67 # Don't "pull" if checkout is not on a named branch | 67 # Don't "pull" if checkout is not on a named branch |
68 shift | 68 shift |
69 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t
hen | 69 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t
hen |
70 first_args="$1 fetch" | 70 first_args="$1 fetch" |
71 else | 71 else |
72 first_args="$1 $2" | 72 first_args="$1 $2" |
73 fi | 73 fi |
74 shift 2 | 74 shift 2 |
75 $first_args $@ | sed "s/^/[$solution] /g" 1>&2 | 75 $first_args $@ | sed "s/^/[$solution] /g" 1>&2 |
76 if [ $? -ne 0 ]; then | 76 status=$? |
77 exit $? | 77 if [ "$status" -ne 0 ]; then |
| 78 exit $status |
78 fi | 79 fi |
79 | 80 |
80 set_target_os | 81 set_target_os |
81 | 82 |
82 "$GIT_EXE" ls-files -s | grep ^160000 | awk '{print $4}' | | 83 "$GIT_EXE" ls-files -s | grep ^160000 | awk '{print $4}' | |
83 while read submod; do | 84 while read submod; do |
84 process_submodule "$submod" | 85 process_submodule "$submod" |
85 done | 86 done |
86 status=$? | 87 status=$? |
87 else | 88 else |
88 submodule="${1#*/}" | 89 submodule="${1#*/}" |
89 echo "[$solution] updating $submodule" | 90 echo "[$solution] updating $submodule" |
90 "$GIT_EXE" submodule update --quiet "$submodule" | | 91 "$GIT_EXE" submodule update --quiet "$submodule" | |
91 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" | 92 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" |
92 status=$? | 93 status=$? |
93 if [ "$status" -ne "0" ]; then | 94 if [ "$status" -ne "0" ]; then |
94 echo "[$solution] FAILED to update $submodule" | 95 echo "[$solution] FAILED to update $submodule" |
95 fi | 96 fi |
96 fi | 97 fi |
97 exit $status | 98 exit $status |
OLD | NEW |