mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Multiple option env file (#4788)
* multi configuration file enabling * improve ignore * update i18n tool dep * update webbpack bundle analyzer version * fix ps cloud test wait setting * fix script content * remove use of testconfig for browser options * convert protractor to ts * download browser util fix
This commit is contained in:
49
scripts/git-util/affected-folder.sh
Executable file
49
scripts/git-util/affected-folder.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
eval BRANCH_NAME=""
|
||||
eval DIRECTORY="tmp"
|
||||
eval HEAD_SHA_BRANCH=""
|
||||
|
||||
show_help() {
|
||||
echo "Usage: affected-folder.sh"
|
||||
echo ""
|
||||
echo "-b branch name"
|
||||
echo "-folder"
|
||||
}
|
||||
|
||||
branch_name(){
|
||||
BRANCH_NAME=$1
|
||||
}
|
||||
|
||||
folder_name(){
|
||||
FOLDER_NAME=$1
|
||||
}
|
||||
|
||||
while [[ $1 == -* ]]; do
|
||||
case "$1" in
|
||||
-b) branch_name $2; shift 2;;
|
||||
-f) folder_name $2; shift 2;;
|
||||
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$BRANCH_NAME" == "" ]]
|
||||
then
|
||||
echo "The branch name is mandatory"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$FOLDER_NAME" == "" ]]
|
||||
then
|
||||
echo "The folder name is mandatory"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$BRANCH_NAME HEAD)"
|
||||
#echo "Branch name $BRANCH_NAME HEAD sha " $HEAD_SHA_BRANCH
|
||||
|
||||
if git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^${FOLDER_NAME}" &> /dev/null
|
||||
then
|
||||
echo ${FOLDER_NAME}
|
||||
fi
|
||||
|
33
scripts/git-util/check-branch-updated.sh
Executable file
33
scripts/git-util/check-branch-updated.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
eval BRANCH_NAME=""
|
||||
|
||||
branch_name(){
|
||||
BRANCH_NAME=$1
|
||||
}
|
||||
|
||||
show_help() {
|
||||
echo "Usage: check-branch-updated.sh"
|
||||
echo ""
|
||||
echo "-b branch name"
|
||||
}
|
||||
|
||||
while [[ $1 == -* ]]; do
|
||||
case "$1" in
|
||||
-b) branch_name $2; shift 2;;
|
||||
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$BRANCH_NAME" == "" ]]
|
||||
then
|
||||
echo "The branch name is mandatory"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
hash1=$(git show-ref --heads -s development)
|
||||
hash2=$(git merge-base development $BRANCH_NAME)
|
||||
[ "${hash1}" = "${hash2}" ] && echo "Branch up to date" || { echo "Branch needs to be rebeased"; exit 1; }
|
||||
|
||||
echo "Development branch HEAD sha " $hash1
|
||||
echo "$BRANCH_NAME branch HEAD sha " $hash2
|
Reference in New Issue
Block a user