Skip to content

Commit 1c28e12

Browse files
nawazkhk8s-infra-cherrypick-robot
authored andcommitted
update verify-starlark.sh to latest v8.0.3 release
1 parent c08d28d commit 1c28e12

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

hack/verify-starlark.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,29 @@ set -o pipefail
2020
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
2121
ROOT_PATH="$(cd "${SCRIPT_DIR}"/.. && pwd)"
2222

23-
VERSION="0.29.0"
23+
VERSION="v8.0.3"
2424

2525
MODE="check"
2626

2727
if [[ "$*" == "fix" ]]; then
2828
MODE="fix"
2929
fi
3030

31-
if [[ "${OSTYPE}" == "linux"* ]]; then
32-
BINARY="buildifier"
33-
elif [[ "${OSTYPE}" == "darwin"* ]]; then
34-
BINARY="buildifier.mac"
31+
OS="$(uname -s)"
32+
ARCH="$(uname -m)"
33+
34+
# Determine OS-specific binary name
35+
if [[ "${OS}" == "Linux" ]]; then
36+
BINARY="buildifier-linux"
37+
elif [[ "${OS}" == "Darwin" ]]; then
38+
BINARY="buildifier-darwin"
39+
fi
40+
41+
# Append architecture suffix for the appropriate binary
42+
if [[ "${ARCH}" == "x86_64" ]] || [[ "${ARCH}" == "amd64" ]]; then
43+
BINARY="${BINARY}-amd64" # No change needed, this is the default
44+
elif [[ "${ARCH}" == "arm64" ]] || [[ "${ARCH}" == "aarch64" ]]; then
45+
BINARY="${BINARY}-arm64"
3546
fi
3647

3748
# create a temporary directory
@@ -68,4 +79,4 @@ fi
6879

6980
echo "Running buildifier..."
7081
cd "${ROOT_PATH}" || exit
71-
"${BUILDIFIER}" -mode=${MODE} Tiltfile >> "${OUT}" 2>&1
82+
"${BUILDIFIER}" -mode=${MODE} -v Tiltfile >> "${OUT}" 2>&1

0 commit comments

Comments
 (0)