install.sh: use ~/.local/bin, print PATH hint

This commit is contained in:
Chris Davies
2026-02-13 14:04:19 -05:00
parent f795e6e06d
commit dc136bdd29

View File

@@ -3,7 +3,7 @@ set -e
REPO="chris/agent-tui" REPO="chris/agent-tui"
BASE_URL="https://gitea.yeeted.lol" BASE_URL="https://gitea.yeeted.lol"
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}" INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/bin}"
OS=$(uname -s | tr '[:upper:]' '[:lower:]') OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m) ARCH=$(uname -m)
@@ -48,12 +48,17 @@ else
fi fi
chmod +x "$TMP" chmod +x "$TMP"
mkdir -p "$INSTALL_DIR"
if [ -w "$INSTALL_DIR" ]; then mv "$TMP" "${INSTALL_DIR}/agent-tui"
mv "$TMP" "${INSTALL_DIR}/agent-tui"
else
echo "Installing to ${INSTALL_DIR} (requires sudo)..."
sudo mv "$TMP" "${INSTALL_DIR}/agent-tui"
fi
echo "Installed agent-tui ${TAG} to ${INSTALL_DIR}/agent-tui" echo "Installed agent-tui ${TAG} to ${INSTALL_DIR}/agent-tui"
# Check if INSTALL_DIR is in PATH
case ":$PATH:" in
*":${INSTALL_DIR}:"*) ;;
*)
echo ""
echo "Add to your PATH by running:"
echo " echo 'export PATH=\"${INSTALL_DIR}:\$PATH\"' >> ~/.zshrc && source ~/.zshrc"
;;
esac