summaryrefslogtreecommitdiff
path: root/script/update/project/release
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-10-14 00:35:02 +0100
committerLeah Rowe <leah@libreboot.org>2023-10-14 00:35:02 +0100
commit7cd84aec285bf2ecf4c7c663adc5e4e5000492f4 (patch)
treea3c3609487494aa52bc1b00c357ac31b805a89e8 /script/update/project/release
parentb5db04808919b510a3df153f882cdb4676876d07 (diff)
update/release: use getops OPTARG correctly
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/update/project/release')
-rwxr-xr-xscript/update/project/release11
1 files changed, 5 insertions, 6 deletions
diff --git a/script/update/project/release b/script/update/project/release
index a20703ac..426db72a 100755
--- a/script/update/project/release
+++ b/script/update/project/release
@@ -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}"