build: use subshells when changing directories

This prevents being left in the wrong directory in case of error.
This commit is contained in:
Georgios Kalpakas
2017-05-12 22:07:51 +03:00
committed by Igor Minar
parent 21d213dfc7
commit 06264645fd
7 changed files with 114 additions and 109 deletions

View File

@ -30,11 +30,12 @@ function prepare {
if [ -d "$REPO_DIR" ]; then
cd $REPO_DIR
git fetch --update-shallow origin
git checkout master
git merge --ff-only origin/master
cd -
(
cd $REPO_DIR
git fetch --update-shallow origin
git checkout master
git merge --ff-only origin/master
)
else
echo "-- Cloning code.angularjs.org into $REPO_DIR"
git clone git@github.com:angular/code.angularjs.org.git $REPO_DIR --depth=1