Skip to content

Commit

Permalink
refactor: simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonschroeder-sfdc committed Jun 28, 2024
1 parent 60f232b commit 3417b4c
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .bazelci/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,13 @@ print_error () {
}

# Get the operating system
os=$(uname)
os=$(uname | tr '[:upper:]' '[:lower:]')

# Get the machine architecture
arch=$(uname -m)

# Set the correct Google Java Formatter URL based on the operating system and architecture
if [ "$os" == "Darwin" ] && [ "$arch" == "arm64" ]; then
JAVA_FORMATTER_URL="https://github.com/google/google-java-format/releases/download/v1.22.0/google-java-format_darwin-arm64"
elif [ "$os" == "Linux" ] && [ "$arch" == "x86_64" ]; then
JAVA_FORMATTER_URL="https://github.com/google/google-java-format/releases/download/v1.22.0/google-java-format_linux-x86_64"
else
print_error "Error: Unsupported operating system or architecture. See https://github.com/google/google-java-format/issues/1115"
exit 10
fi
JAVA_FORMATTER_URL="https://github.com/google/google-java-format/releases/download/v1.22.0/google-java-format_${os}-${arch}"
LOCAL_FORMATTER="./google-java-format"

if [ -z "$BAZEL" ]; then
Expand Down

0 comments on commit 3417b4c

Please sign in to comment.