[ADF-4569] Fix affected-libs.sh script (#4734)

* [ADF-4569] Fix affected-libs.sh script

* [ADF-4569] Create new script to check if branch is updated
This commit is contained in:
davidcanonieto
2019-05-17 15:03:22 +01:00
committed by Maurizio Vitale
parent 52c5ec03bc
commit 80da3e9932
4 changed files with 36 additions and 27 deletions

View File

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