better argument parsing

This commit is contained in:
Alex Janka 2024-05-18 12:54:01 +10:00
parent 8edbd95461
commit 029044580e
5 changed files with 5 additions and 5 deletions

View file

@ -70,7 +70,7 @@ for ((i = 1; i < ${#tarballs[@]}; i += 2)); do
if [[ "$arch" == "core-arm64" ]]; then
arch="arm64"
fi
if [ -z "$1" ] || [[ "$arch" == "$1" ]]; then
if [ $# -eq 0 ] || (( $@[(Ie)$arch])); then
echo "Building for $arch..."
dir=$(mktemp -d)
current_dir=$PWD

View file

@ -63,7 +63,7 @@ for ((i = 1; i < ${#tarballs[@]}; i += 2)); do
if [[ "$arch" == "core-arm64" ]]; then
arch="arm64"
fi
if [ -z "$1" ] || [[ "$arch" == "$1" ]]; then
if [ $# -eq 0 ] || (( $@[(Ie)$arch])); then
echo "Building for $arch..."
dir=$(mktemp -d)
current_dir=$PWD

View file

@ -68,7 +68,7 @@ for ((i = 1; i < ${#tarballs[@]}; i += 2)); do
if [[ "$arch" == "core-arm64" ]]; then
arch="arm64"
fi
if [ -z "$1" ] || [[ "$arch" == "$1" ]]; then
if [ $# -eq 0 ] || (( $@[(Ie)$arch])); then
echo "Building for $arch..."
dir=$(mktemp -d)
current_dir=$PWD

View file

@ -68,7 +68,7 @@ for ((i = 1; i < ${#tarballs[@]}; i += 2)); do
if [[ "$arch" == "core-arm64" ]]; then
arch="arm64"
fi
if [ -z "$1" ] || [[ "$arch" == "$1" ]]; then
if [ $# -eq 0 ] || (( $@[(Ie)$arch])); then
echo "Building for $arch..."
dir=$(mktemp -d)
current_dir=$PWD

View file

@ -64,7 +64,7 @@ for ((i = 1; i < ${#tarballs[@]}; i += 2)); do
if [[ "$arch" == "arm" ]]; then
arch="armhf"
fi
if [ -z "$1" ] || [[ "$arch" == "$1" ]]; then
if [ $# -eq 0 ] || (( $@[(Ie)$arch])); then
echo "Building for $arch..."
dir=$(mktemp -d)
current_dir=$PWD