From 01296902d56a1a31c4ee5fe651392441f6acd54c Mon Sep 17 00:00:00 2001 From: Tao <59834693+worldofgeese@users.noreply.github.com> Date: Thu, 30 Nov 2023 14:14:33 +0100 Subject: [PATCH 1/3] feat(just): add garden.io --- just/custom.just | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/just/custom.just b/just/custom.just index 3008f0e2d67..4209c6b15a3 100644 --- a/just/custom.just +++ b/just/custom.just @@ -149,6 +149,17 @@ jetbrains-toolbox: echo "Launching JetBrains Toolbox" ./jetbrains-toolbox-"${BUILD_VERSION}"/jetbrains-toolbox +# Install garden.io, the Cloud Native DevOps automation platform | https://garden.io + #!/usr/bin/env bash + command -v garden &> /dev/null || ( + ASSET_URL=$(curl -s https://api.github.com/repos/garden-io/garden/releases/latest | \ + jq -r '.assets[] | select(.browser_download_url | test("linux-amd64.tar.gz$")) | .browser_download_url') + curl -sSL $ASSET_URL | tar xz && \ + GARDEN_DIR=${HOME}/.garden + TARGET_PATH=${GARDEN_DIR}/bin + mkdir -p "${GARDEN_DIR}" + mv linux-amd64/* "${TARGET_PATH}" + # Install nix and Devbox nix-devbox: echo 'Setting phasers to kill. Installing nix.' From 3ee48c767df0b2114ff141e8f7851f80934920ce Mon Sep 17 00:00:00 2001 From: Tao <59834693+worldofgeese@users.noreply.github.com> Date: Thu, 30 Nov 2023 14:22:57 +0100 Subject: [PATCH 2/3] fix: missing parens and echo message --- just/custom.just | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/just/custom.just b/just/custom.just index 4209c6b15a3..c91efdc9596 100644 --- a/just/custom.just +++ b/just/custom.just @@ -150,16 +150,27 @@ jetbrains-toolbox: ./jetbrains-toolbox-"${BUILD_VERSION}"/jetbrains-toolbox # Install garden.io, the Cloud Native DevOps automation platform | https://garden.io - #!/usr/bin/env bash - command -v garden &> /dev/null || ( - ASSET_URL=$(curl -s https://api.github.com/repos/garden-io/garden/releases/latest | \ - jq -r '.assets[] | select(.browser_download_url | test("linux-amd64.tar.gz$")) | .browser_download_url') - curl -sSL $ASSET_URL | tar xz && \ - GARDEN_DIR=${HOME}/.garden - TARGET_PATH=${GARDEN_DIR}/bin - mkdir -p "${GARDEN_DIR}" - mv linux-amd64/* "${TARGET_PATH}" - +garden: + #!/usr/bin/env bash + command -v garden &> /dev/null || ( + ASSET_URL=$(curl -s https://api.github.com/repos/garden-io/garden/releases/latest | \ + jq -r '.assets[] | select(.browser_download_url | test("linux-amd64.tar.gz$")) | .browser_download_url') + curl -sSL $ASSET_URL | tar xz && \ + GARDEN_DIR=${HOME}/.garden + TARGET_PATH=${GARDEN_DIR}/bin + mkdir -p "${GARDEN_DIR}" + mv linux-amd64/* "${TARGET_PATH}") + + echo "" + echo "🌺🌻 Garden has been successfully installed πŸŒ·πŸ’" + echo "" + echo "Add the Garden CLI to your path by adding the following to your .bashrc/.zshrc:" + echo "" + echo " export PATH=\$PATH:\$HOME/.garden/bin" + echo "" + echo "Head over to our documentation for next steps: https://docs.garden.io" + echo "" + # Install nix and Devbox nix-devbox: echo 'Setting phasers to kill. Installing nix.' From 94216e8de8632a8ffacf4c582fd13e287305b03f Mon Sep 17 00:00:00 2001 From: Tao <59834693+worldofgeese@users.noreply.github.com> Date: Thu, 30 Nov 2023 15:16:17 +0100 Subject: [PATCH 3/3] fix: extract to tmp; fix syntax --- just/custom.just | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/just/custom.just b/just/custom.just index c91efdc9596..16b305b7814 100644 --- a/just/custom.just +++ b/just/custom.just @@ -152,25 +152,27 @@ jetbrains-toolbox: # Install garden.io, the Cloud Native DevOps automation platform | https://garden.io garden: #!/usr/bin/env bash - command -v garden &> /dev/null || ( - ASSET_URL=$(curl -s https://api.github.com/repos/garden-io/garden/releases/latest | \ - jq -r '.assets[] | select(.browser_download_url | test("linux-amd64.tar.gz$")) | .browser_download_url') - curl -sSL $ASSET_URL | tar xz && \ - GARDEN_DIR=${HOME}/.garden - TARGET_PATH=${GARDEN_DIR}/bin - mkdir -p "${GARDEN_DIR}" - mv linux-amd64/* "${TARGET_PATH}") - - echo "" - echo "🌺🌻 Garden has been successfully installed πŸŒ·πŸ’" - echo "" - echo "Add the Garden CLI to your path by adding the following to your .bashrc/.zshrc:" - echo "" - echo " export PATH=\$PATH:\$HOME/.garden/bin" - echo "" - echo "Head over to our documentation for next steps: https://docs.garden.io" - echo "" - + if ! command -v garden &> /dev/null; then + ASSET_URL=$(curl -s https://api.github.com/repos/garden-io/garden/releases/latest | \ + jq -r '.assets[] | select(.browser_download_url | test("linux-amd64.tar.gz$")) | .browser_download_url') + GARDEN_DIR="${HOME}/.garden/bin" + TMP_DIR=$(mktemp -d) + curl -sSL "$ASSET_URL" | tar -xz -C "$TMP_DIR" + mkdir -p "$GARDEN_DIR" + mv "$TMP_DIR"/linux-amd64/garden "$GARDEN_DIR" + rm -rf "$TMP_DIR" + + echo "" + echo "🌺🌻 Garden has been successfully installed πŸŒ·πŸ’" + echo "" + echo "Add the Garden CLI to your path by adding the following to your .bashrc/.zshrc:" + echo "" + echo " export PATH=\$PATH:\$HOME/.garden/bin" + echo "" + echo "Head over to our documentation for next steps: https://docs.garden.io" + echo "" + fi + # Install nix and Devbox nix-devbox: echo 'Setting phasers to kill. Installing nix.'