Skip to content

Commit

Permalink
cmd-build: Fix use of bash arrays
Browse files Browse the repository at this point in the history
The docs and syntax for these are confusing...need to rewrite this
in "not bash".
  • Loading branch information
cgwalters authored and jlebon committed Feb 6, 2019
1 parent 4d4cdaf commit cfc9e0c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cmd-build
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ while true; do
done

declare -a IMAGE_TYPES
for itype in "$@"; do
IMAGE_TYPES[]="$itype"
IMAGE_TYPES=()
# shellcheck disable=SC2068
for itype in $@; do
IMAGE_TYPES+=("$itype")
done
if [ "${IMAGE_TYPES[*]}" == 0 ]; then
if [ "${#IMAGE_TYPES[@]}" == 0 ]; then
IMAGE_TYPES=(qemu)
fi
echo "Image types: ${IMAGE_TYPES[*]}"

export LIBGUESTFS_BACKEND=direct

Expand Down

0 comments on commit cfc9e0c

Please sign in to comment.