afa3e89890
This displays the branch, repo and commitID that was attempted to update to but failed. Users then can compare this output to the configuration they meant to activate in modules and hopefully better find their typos.
29 lines
580 B
Bash
Executable File
29 lines
580 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
. scripts/modules.sh
|
|
|
|
|
|
GLUONDIR="$(pwd)"
|
|
|
|
for module in $GLUON_MODULES; do
|
|
echo "--- Updating module '$module' ---"
|
|
var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_')
|
|
eval repo=\${${var}_REPO}
|
|
eval branch=\${${var}_BRANCH}
|
|
eval commit=\${${var}_COMMIT}
|
|
|
|
mkdir -p "$GLUONDIR/$module"
|
|
cd "$GLUONDIR/$module"
|
|
git init
|
|
|
|
if ! git branch -f base "$commit" 2>/dev/null; then
|
|
git fetch "$repo" "$branch"
|
|
git branch -f base "$commit" || {
|
|
echo "unable to find commit \"$commit\" on branch \"$branch\" in repo \"$repo\"." >&2
|
|
exit 1
|
|
}
|
|
fi
|
|
done
|