From 103d7054d557e6b234bcd6e06c7f29338dc5a83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Wed, 15 Jan 2025 11:23:40 +0000 Subject: [PATCH] chore(spartan): making the spartan script install jq --- spartan/releases/create-spartan.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spartan/releases/create-spartan.sh b/spartan/releases/create-spartan.sh index 6c688eec227..dc857169f77 100755 --- a/spartan/releases/create-spartan.sh +++ b/spartan/releases/create-spartan.sh @@ -18,3 +18,19 @@ else echo -e "${RED}✗ Failed to download aztec-spartan.sh${NC}" exit 1 fi + +# Check if jq is installed +if ! command -v jq &> /dev/null; then + echo "jq is not installed. Installing jq..." + if command -v apt-get &> /dev/null; then + sudo apt-get update && sudo apt-get install -y jq + elif command -v yum &> /dev/null; then + sudo yum install -y jq + elif command -v brew &> /dev/null; then + brew install jq + else + echo -e "${RED}✗ Could not install jq. Please install it manually.${NC}" + exit 1 + fi + echo -e "${GREEN}✓ jq has been installed${NC}" +fi