From 50464aae181af2937292ba5aef8cba529f55f4f2 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Mon, 3 Jun 2024 16:52:30 -0400 Subject: [PATCH] Add a basic install script (#45) Signed-off-by: Juan Cruz Viotti --- CMakeLists.txt | 2 +- README.markdown | 6 ++++++ install | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 install diff --git a/CMakeLists.txt b/CMakeLists.txt index f05154a1..c2a2fa8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ noa_target_clang_format(SOURCES noa_target_clang_tidy(SOURCES src/*.h src/*.cc) noa_target_shellcheck(SOURCES - test/*.sh) + test/*.sh install) # Testing if(JSONSCHEMA_TESTS) diff --git a/README.markdown b/README.markdown index 5a902051..fb035370 100644 --- a/README.markdown +++ b/README.markdown @@ -38,6 +38,12 @@ powerful [JSON Toolkit](https://github.com/sourcemeta/jsontoolkit) library. brew install intelligence-ai/apps/jsonschema ``` +### Using the install script helper + +```sh +/bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/intelligence-ai/jsonschema/main/install -H "Cache-Control: no-cache, no-store, must-revalidate")" +``` + ### From GitHub Releases We publish precompiled binaries for every supported platforms to [GitHub diff --git a/install b/install new file mode 100755 index 00000000..8689dfd0 --- /dev/null +++ b/install @@ -0,0 +1,17 @@ +#!/bin/sh + +set -o errexit +set -o nounset + +UNAME="$(uname)" + +if [ "$UNAME" = "Darwin" ] +then + echo "---- Attempting to install the JSON Schema CLI using Homebrew" 1>&2 + brew install intelligence-ai/apps/jsonschema + exit 0 +fi + +echo "ERROR: I don't know how to install the JSON Schema CLI in $UNAME!" 1>&2 +echo "Open an issue here: https://github.com/Intelligence-AI/jsonschema/issues" 1>&2 +exit 1