Skip to content

Commit b4723f7

Browse files
committed
allow KAT_INSTALL_DIR to be overridable
1 parent 7191f0d commit b4723f7

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎doc/installation.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,17 @@ For macOS and Linux, the easiest way to install Kat is using the install script:
3232

3333
```bash
3434
# Install latest version (automatically fetches the latest release)
35-
curl -sSL https://kat.bolaji.de/install | bash
35+
curl -sSL https://kat.bolaji.de/install | sudo bash
3636

3737
# Install specific version
38-
curl -sSL https://kat.bolaji.de/install | VERSION=v1.0.0 bash
38+
curl -sSL https://kat.bolaji.de/install | VERSION=v1.0.0 sudo bash
39+
40+
# Install to a custom directory (no sudo required if you have write permissions)
41+
curl -sSL https://kat.bolaji.de/install | KAT_INSTALL_DIR=$HOME/bin bash
3942
```
4043

44+
> **Note:** `sudo` is required because the script installs Kat to `/usr/local/bin`, which typically requires administrator privileges. If you want to install without sudo, you can modify the installation directory by setting the `KAT_INSTALL_DIR` environment variable to a location you have write permissions for (e.g., `KAT_INSTALL_DIR=$HOME/bin`).
45+
4146
This will:
4247
1. Detect your operating system (macOS or Linux)
4348
2. Fetch the latest release version from GitHub if no version is specified

‎install.sh‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ if [ -z "$VERSION" ]; then
2424
echo "Latest version: '$VERSION'"
2525
fi
2626

27-
INSTALL_DIR="/usr/local/bin"
27+
# Allow users to override the installation directory
28+
KAT_INSTALL_DIR=${KAT_INSTALL_DIR:-"/usr/local/bin"}
2829
OS=$(uname | tr '[:upper:]' '[:lower:]')
2930

3031
# Detect architecture
@@ -62,6 +63,6 @@ fi
6263

6364
# Download and extract binary
6465
echo "Downloading 'kat $VERSION' for $OS ($ARCH)..."
65-
curl -sL "$DOWNLOAD_URL" | tar xz -C $INSTALL_DIR kat
66+
curl -sL "$DOWNLOAD_URL" | tar xz -C "$KAT_INSTALL_DIR" kat
6667

67-
echo "kat $VERSION has been installed in '$INSTALL_DIR'"
68+
echo "kat $VERSION has been installed in '$KAT_INSTALL_DIR'"

0 commit comments

Comments
 (0)
⌂ 换网址