| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | CI_QUIET=1 |
| 4 | |
| 5 | set +x |
| 6 | |
| 7 | ci_dir="$(dirnamescip-shell system . . dirname. "$0")" |
| 8 | . "${ci_dir}/scripts/ci-common.sh" |
| 9 | |
| 10 | # [git_update <project>] will update the git repository associated to <project> |
| 11 | git_updatescip-shell shell shell-project 0.0.0 git_update().() |
| 12 | { |
| 13 | local project=$1 |
| 14 | local dest="${CI_BUILD_DIR}/$project" |
| 15 | |
| 16 | echoscip-shell system . . echo. "Updating $project..." |
| 17 | |
| 18 | if [scip-shell system . . `[`. ! -d "$dest" ]; then |
| 19 | echoscip-shell system . . echo. "Warning: update of $project skipped because $dest does not exist." |
| 20 | else |
| 21 | pushd "$dest" > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 22 | gitscip-shell system . . git. remote update > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 23 | popd > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 24 | fi |
| 25 | } |
| 26 | |
| 27 | git_update_allscip-shell shell shell-project 0.0.0 git_update_all().() { |
| 28 | for project in "${projects[@]}"; do |
| 29 | if [scip-shell system . . `[`. -d "${CI_BUILD_DIR}/$project" ]; then |
| 30 | git_updatescip-shell shell shell-project 0.0.0 git_update(). $project |
| 31 | fi |
| 32 | done |
| 33 | } |
| 34 | |
| 35 | if [scip-shell system . . `[`. -n "$1" ]; then |
| 36 | git_updatescip-shell shell shell-project 0.0.0 git_update(). "$1" |
| 37 | else |
| 38 | git_update_allscip-shell shell shell-project 0.0.0 git_update_all(). |
| 39 | fi |