mirror of
https://github.com/Alfresco/acs-community-packaging.git
synced 2025-09-10 14:12:09 +00:00
11 lines
364 B
Bash
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" |