From cd8323fe06087c7481701341fdb6d6a4a4de68e3 Mon Sep 17 00:00:00 2001 From: Georgi Matev Date: Sun, 30 Oct 2022 20:43:16 -0700 Subject: [PATCH] Fix build.sh usage function (#1368) ## Description Usage function not defined before use params are not properly specified ## Type of change - [ ] :sunflower: Feature - [x] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [x] :hamster: Trivial/Minor ## Issue(s) ## Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- build/build.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build/build.sh b/build/build.sh index b9d6685cf..0e3f33dd0 100755 --- a/build/build.sh +++ b/build/build.sh @@ -2,6 +2,15 @@ set -e +usage() { + echo "Usage: $(basename $0) binary | image [--platforms ...] [--tag ...]" + echo "" + echo "OPTIONS" + echo " -p | --platforms Platforms to build for (default: $PLATFORMS)" + echo " Specify multiple platforms using ',' (eg: linux/amd64,darwin/arm)" + echo " -t | --tag Tag for container image (default: $TAG)" +} + ROOT=$(dirname $(dirname $(readlink -f $0))) GOVER=1.18 # go version CORSO_BUILD_CACHE="/tmp/.corsobuild" # shared persistent cache @@ -44,15 +53,6 @@ while [ "$#" -gt 0 ]; do shift done -usage() { - echo "Usage: $(basename $0) binary | image [--platforms ...] [--tag ...]" - echo "" - echo "OPTIONS" - echo " -p | --platforms Platforms to build for (default: $PLATFORMS)" - echo " Specify multiple platforms using ',' (eg: linux/amd64,darwin/arm)" - echo " -t | --tag Tag for container image (default: $TAG)" -} - if [ "$MODE" == "binary" ]; then mkdir -p ${CORSO_BUILD_CACHE} # prep env for platform in ${PLATFORMS/,/ }; do