Files
acs-community-packaging/scripts/travis/V2/common_functions.sh
2020-03-06 14:19:47 +00:00

11 lines
364 B
Bash

# Will echo value of the provided variablePrefix from the commit message Example useage and output:
# $ extractVariable "release" "[skipTests][release=6.3.0]"
# $ 6.3.0
extractVariable()
{
local variablePrefix=$1 commitMessage=$2
regex="\[$variablePrefix[^\]]*=\K[^\]]*(?=\])"
echo $commitMessage | grep -Po $regex
}
echo "common_function.sh loaded"