feat: add CONFIGURE=false option in install script (#920)

This commit is contained in:
Kalvin C
2025-01-30 08:29:15 -08:00
committed by GitHub
parent ff71de422b
commit aea45dfaf2
3 changed files with 48 additions and 35 deletions

View File

@@ -29,6 +29,9 @@ import RateLimits from '@site/src/components/RateLimits';
:::tip Best Practice
Its best to keep Goose updated. You can update it by re-running the installation script.
:::
:::tip Automation
You can disable automatic interactive configuration by adding `| CONFIGURE=false bash` to the script above.
:::
</TabItem>
<TabItem value="ui" label="Goose Desktop">
To install Goose, click the **button** below:

View File

@@ -28,6 +28,9 @@ You can use Goose via CLI or Desktop application.
```sh
curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | bash
```
:::tip Automation
You can disable automatic interactive configuration by adding `| CONFIGURE=false bash` to the script above.
:::
</TabItem>
<TabItem value="ui" label="Goose Desktop">
To install the latest version of Goose, click the **button** below:

View File

@@ -18,6 +18,7 @@ set -eu
# GOOSE_PROVIDER - Optional: provider for goose
# GOOSE_MODEL - Optional: model for goose
# CANARY - Optional: if set to "true", downloads from canary release instead of stable
# CONFIGURE - Optional: if set to "false", disables running goose configure interactively
# ** other provider specific environment variables (eg. DATABRICKS_HOST)
##############################################################################
@@ -33,6 +34,7 @@ OUT_FILE="goose"
GOOSE_BIN_DIR="${GOOSE_BIN_DIR:-"$HOME/.local/bin"}"
RELEASE="${CANARY:-false}"
RELEASE_TAG="$([[ "$RELEASE" == "true" ]] && echo "canary" || echo "stable")"
CONFIGURE="${CONFIGURE:-true}"
# --- 3) Detect OS/Architecture ---
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
@@ -92,11 +94,16 @@ fi
echo "Moving goose to $GOOSE_BIN_DIR/$OUT_FILE"
mv goose "$GOOSE_BIN_DIR/$OUT_FILE"
# --- 6) Configure Goose (Optional) ---
echo ""
echo "Configuring Goose"
echo ""
"$GOOSE_BIN_DIR/$OUT_FILE" configure
# skip configuration for non-interactive installs e.g. automation, docker
if [ "$CONFIGURE" = true ]; then
# --- 6) Configure Goose (Optional) ---
echo ""
echo "Configuring Goose"
echo ""
"$GOOSE_BIN_DIR/$OUT_FILE" configure
else
echo "Skipping 'goose configure', you may need to run this manually later"
fi
# --- 7) Check PATH and give instructions if needed ---
if [[ ":$PATH:" != *":$GOOSE_BIN_DIR:"* ]]; then