Skip to content

Commit

Permalink
setup.sh: require yq only when -f option is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Apr 1, 2024
1 parent 50c34bf commit d885ff9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ if ! check_command jq; then
exit 1
fi

if ! check_command yq; then
echo "yq not found. Install it from https://mikefarah.gitbook.io/yq"
exit 1
fi

OS_NAME=$(echo "$RUNNER_OS" | awk '{print tolower($0)}')
ARCH_NAME=$(echo "$RUNNER_ARCH" | awk '{print tolower($0)}')
MANIFEST_BASE_URL="https://storage.googleapis.com/flutter_infra_release/releases"
Expand Down Expand Up @@ -93,15 +88,19 @@ while getopts 'tc:k:d:l:pa:n:f:' flag; do
t) TEST_MODE=true ;;
a) ARCH="$(echo "$OPTARG" | awk '{print tolower($0)}')" ;;
n) VERSION="$OPTARG" ;;
f) VERSION_FILE="$OPTARG" ;;
f)
VERSION_FILE="$OPTARG"
if [ -n "$VERSION_FILE" ] && ! check_command yq; then
echo "yq not found. Install it from https://mikefarah.gitbook.io/yq"
exit 1
fi
;;
?) exit 2 ;;
esac
done

[ -z "$ARCH" ] && ARCH="$ARCH_NAME"



if [ -n "$VERSION_FILE" ]; then
if [ -n "$VERSION" ]; then
echo "Cannot specify both a version and a version file"
Expand Down

0 comments on commit d885ff9

Please sign in to comment.