gluon/scripts/update.sh

26 lines
470 B
Bash
Raw Normal View History

2013-12-28 14:11:59 +00:00
#!/bin/bash
2013-12-28 13:54:49 +00:00
set -e
2017-01-18 16:21:43 +00:00
. scripts/modules.sh
GLUONDIR="$(pwd)"
2013-12-28 13:54:49 +00:00
for module in $GLUON_MODULES; do
echo "--- Updating module '$module' ---"
2016-09-24 15:34:14 +00:00
var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_')
2014-01-02 14:16:32 +00:00
eval repo=\${${var}_REPO}
eval branch=\${${var}_BRANCH}
2014-01-02 14:16:32 +00:00
eval commit=\${${var}_COMMIT}
2016-09-24 15:34:14 +00:00
mkdir -p "$GLUONDIR/$module"
cd "$GLUONDIR/$module"
git init
2016-09-24 15:34:14 +00:00
if ! git branch -f base "$commit" 2>/dev/null; then
git fetch "$repo" "$branch"
git branch -f base "$commit"
fi
2013-12-28 13:54:49 +00:00
done