Improve Rebase branch script (#4742)

* Improve Rebase branch script

* Improve Rebase branch script

* add comment
This commit is contained in:
davidcanonieto
2019-05-17 16:46:29 +01:00
committed by Maurizio Vitale
parent 80da3e9932
commit 514b31d975
2 changed files with 16 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
eval BRANCH_NAME=""
eval HEAD_SHA_BRANCH=""
eval DIRECTORY="tmp"
eval GNU=false
@@ -41,10 +42,9 @@ then
exit 0
fi
#check if branch needs to be updated
./scripts/check-branch-updated.sh -b $BRANCH_NAME || exit 1;
# tmp folder doesn't exist.
if [ ! -d "$DIRECTORY" ]; then
#find affected libs
@@ -52,6 +52,12 @@ if [ ! -d "$DIRECTORY" ]; then
mkdir $DIRECTORY;
fi
HEAD_SHA_BRANCH="$(git merge-base origin/$BRANCH_NAME HEAD)"
if [ ! -f $DIRECTORY/deps.txt ]; then
npm run affected:libs -- $HEAD_SHA_BRANCH "HEAD" > $DIRECTORY/deps.txt
fi
cat $DIRECTORY/deps.txt
#echo "extensions" > deps.txt