fix: handle missing argument for --main option

Fixed 'unbound variable' error when using --main without additional arguments.
Added check for argument count before accessing $2.
This commit is contained in:
Pulse Monitor
2025-09-11 15:20:39 +00:00
parent 9cee368fc7
commit 6b6571e650
+1 -1
View File
@@ -2254,7 +2254,7 @@ while [[ $# -gt 0 ]]; do
--main|--source|--from-source|--branch)
BUILD_FROM_SOURCE=true
# Optional: specify branch
if [[ -n "$2" ]] && [[ ! "$2" =~ ^-- ]]; then
if [[ $# -gt 1 ]] && [[ -n "$2" ]] && [[ ! "$2" =~ ^-- ]]; then
SOURCE_BRANCH="$2"
shift 2
else