Skip to content

Commit

Permalink
Make install script prefer pre-built binaries on macOS too
Browse files Browse the repository at this point in the history
For version selection

Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti committed Jun 3, 2024
1 parent fdc495c commit 3d87a7c
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,7 @@ set -o nounset
UNAME="$(uname)"
ARCH="$(uname -m)"

if [ "$UNAME" = "Darwin" ]
then
if [ "$ARCH" != "arm64" ]
then
echo "ERROR: There are no pre-built JSON Schema CLI binaries for macOS on $ARCH" 1>&2
echo "You might be able to build it from source" 1>&2
exit 1
fi

echo "---- Attempting to install the JSON Schema CLI using Homebrew" 1>&2
brew install intelligence-ai/apps/jsonschema
elif [ "$UNAME" = "Linux" ]
if [ "$UNAME" = "Darwin" ] || [ "$UNAME" = "Linux" ]
then
echo "---- Fetching the pre-built JSON Schema CLI binary from GitHub Releases" 1>&2
OWNER="intelligence-ai"
Expand All @@ -31,7 +20,7 @@ then
TMP="$(mktemp -d)"
clean() { rm -rf "$TMP"; }
trap clean EXIT
curl --location --output "$TMP/artifact.zip" "$PACKAGE_URL"
curl --location --output "$TMP/artifact.zip" "$PACKAGE_URL"
unzip "$TMP/artifact.zip" -d "$TMP/out"
mkdir -p "$OUTPUT/bin"
install -v -m 0755 "$TMP/out/jsonschema-$LATEST_TAG-$PACKAGE_PLATFORM_NAME-$ARCH/bin/jsonschema" "$OUTPUT/bin"
Expand Down

0 comments on commit 3d87a7c

Please sign in to comment.