| 1 |
# -------------------------------------------------------------------------- |
| 2 |
# --- Pulling Dome Updates |
| 3 |
# -------------------------------------------------------------------------- |
| 4 |
|
| 5 |
if [ ! -z "$(git status --porcelain)" ] |
| 6 |
then |
| 7 |
echo "Local non-commited modifications, aborted." |
| 8 |
exit 1 |
| 9 |
fi |
| 10 |
|
| 11 |
if [ ! -d .gitdome ] |
| 12 |
then |
| 13 |
git clone [email protected]:dome/electron.git .gitdome |
| 14 |
fi |
| 15 |
|
| 16 |
head=$(git rev-parse --abbrev-ref HEAD) |
| 17 |
commit=$(git -C .gitdome rev-parse HEAD) |
| 18 |
remote=$(git -C .gitdome rev-parse --abbrev-ref HEAD) |
| 19 |
|
| 20 |
git checkout stable/dome |
| 21 |
|
| 22 |
if [ "$?" != "0" ] |
| 23 |
then |
| 24 |
echo "Missing local branch stable/dome, aborted." |
| 25 |
exit 1 |
| 26 |
fi |
| 27 |
|
| 28 |
echo "Pulling Dome updates from $remote to stable/dome..." |
| 29 |
git -C .gitdome pull --prune |
| 30 |
|
| 31 |
for f in $(git -C .gitdome ls-files) |
| 32 |
do |
| 33 |
mkdir -p $(dirname $f) |
| 34 |
cp -f .gitdome/$f $f |
| 35 |
git add $f |
| 36 |
done |
| 37 |
|
| 38 |
if [ ! -z "$(git status --porcelain)" ] |
| 39 |
then |
| 40 |
git commit -m "[Dome] $commit" |
| 41 |
echo "Dome repository updated." |
| 42 |
git checkout $head |
| 43 |
echo "Merging Dome updates..." |
| 44 |
git merge stable/dome |
| 45 |
else |
| 46 |
echo "Dome is already up-to-date." |
| 47 |
git checkout $head |
| 48 |
fi |
| 49 |
|
| 50 |
# -------------------------------------------------------------------------- |