Skip to content

Instantly share code, notes, and snippets.

@stefreak
Forked from twelvemo/install.sh
Last active June 11, 2025 18:11
Show Gist options
  • Select an option

  • Save stefreak/c19b5e42a749a54ee3a98709ba2ab8d0 to your computer and use it in GitHub Desktop.

Select an option

Save stefreak/c19b5e42a749a54ee3a98709ba2ab8d0 to your computer and use it in GitHub Desktop.
Install grow
#! /bin/sh
set -e
# Print our lovely banner image
echo "                                   
                                   
                                   
                                   
                                   
                                   
                                   
"
echo "❊ Installing the Grow CLI ❊"
echo ""
if [[ -n $1 ]]
then
## allow setting the grow version by using a positional parameter
GROW_VERSION=$1
else
## allow setting the grow version using an env var too. This is helpful for this use case: curl ... | GROW_VERSION="1.2.3" bash
GROW_VERSION="${GROW_VERSION:-latest}"
fi
bun_version="1.2.15" # remember to update bun install version in .github/workflows as well
fresh_bun_install=false
echo "→ Checking for bun..."
if ! bun --version | grep "$bun_version" &> /dev/null
then
echo "→ Installing bun..."
# TODO: We are pinning the bun version on the user's machine here globally.
# Either we ship binaries once https://github.com/oven-sh/bun/issues/7208 has been resolved, or we install a separate instance of bun only for grow so we don't interfere.
curl -fsSL https://bun.sh/install | bash -s "bun-v$bun_version"
# add bun to PATH in current shell
export PATH=$PATH:$HOME/.bun/bin
fresh_bun_install=true
fi
echo "→ Installing grow..."
bun add --global @garden-io/grow-core@${GROW_VERSION}
echo ""
echo "🌺🌻 Grow has been successfully installed 🌷💐"
echo ""
if ${fresh_bun_install}
then
echo ""
echo "You can either restart your terminal to use grow"
echo "or run this command to add bun to your current shell's PATH:"
echo "export PATH=\$PATH:\$HOME/.bun/bin"
echo ""
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment