update/release: use getops OPTARG correctly

Signed-off-by: Leah Rowe <leah@libreboot.org>
btrfsvols
Leah Rowe 2023-10-14 00:35:02 +01:00
parent b5db048089
commit 7cd84aec28
1 changed files with 5 additions and 6 deletions

View File

@ -21,15 +21,14 @@ cbfstool="cbutils/default/cbfstool"
main()
{
vdir="release"
while getopts d:m: option
do
case "${1}" in
-d) vdir="${2}" ;;
-m) mode="${2}" ;;
while getopts d:m: option; do
[ -z "${OPTARG}" ] && err "Empty argument not allowed"
case "${option}" in
d) vdir="${OPTARG}" ;;
m) mode="${OPTARG}" ;;
*) err "Invalid option" ;;
esac
done
[ -z "${vdir}" ] && err "Empty directory names not allowed"
vdir="${vdir}/${version}"
basename="${projectname}-${version}"