Fix branch name checker for automatic codegen script (#1980)
This commit is contained in:
@ -65,11 +65,11 @@ case $CMD in
|
|||||||
if [ -v "$VERSION" ] || [[ -z "$VERSION" ]]; then
|
if [ -v "$VERSION" ] || [[ -z "$VERSION" ]]; then
|
||||||
# fall back to branch name or `main` if no VERSION is set
|
# fall back to branch name or `main` if no VERSION is set
|
||||||
branch_name=$(git rev-parse --abbrev-ref HEAD)
|
branch_name=$(git rev-parse --abbrev-ref HEAD)
|
||||||
if [[ "$branch_name" =~ ^\d+\.\d+ ]]; then
|
if [[ "$branch_name" =~ ^[0-9]+\.[0-9]+ ]]; then
|
||||||
echo -e "\033[36;1mTARGET: codegen -> No VERSION found, using branch name: \`$VERSION\`\033[0m"
|
echo -e "\033[36;1mTARGET: codegen -> No VERSION argument found, using branch name: \`$branch_name\`\033[0m"
|
||||||
VERSION="$branch_name"
|
VERSION="$branch_name"
|
||||||
else
|
else
|
||||||
echo -e "\033[36;1mTARGET: codegen -> No VERSION found, using \`main\`\033[0m"
|
echo -e "\033[36;1mTARGET: codegen -> No VERSION argument found, using \`main\`\033[0m"
|
||||||
VERSION="main"
|
VERSION="main"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user