Skip to content

Commit 9937cbe

Browse files
committed
fix(scripts): handle unset gpu_device_flag array safely
This syntax only expands the array if it's set and non-empty, avoiding the "unbound variable" error when the array is empty. Signed-off-by: Dorin Geman <[email protected]>
1 parent c733ed7 commit 9937cbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/docker-run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ main() {
2222
-e DMR_ORIGINS="$DMR_ORIGINS" \
2323
-e DO_NOT_TRACK="$DO_NOT_TRACK" \
2424
-e DEBUG="$DEBUG" \
25-
"${gpu_device_flag[@]}" \
25+
"${gpu_device_flag[@]+"${gpu_device_flag[@]}"}" \
2626
"$DOCKER_IMAGE"
2727
}
2828

0 commit comments

Comments
 (0)