Restrict characters to those supported by semvar_bash

This commit is contained in:
Michael Vines 2018-10-25 16:18:08 -07:00
parent d46682d1f2
commit 0f32102684
No known key found for this signature in database
GPG Key ID: 33F4FDEC4E0E88BD
1 changed files with 7 additions and 2 deletions

View File

@ -58,8 +58,13 @@ major)
minor)
MINOR=$((MINOR+ 1))
;;
-[A-Za-z0-9]*$)
SPECIAL="$1"
-*)
if [[ $1 =~ ^-[A-Za-z0-9]*$ ]]; then
SPECIAL="$1"
else
echo "Error: Unsupported characters found in $1"
exit 1
fi
;;
*)
echo "Error: unknown argument: $1"