From fdc9219742d819e9453fe6fbce913f8cc73b3603 Mon Sep 17 00:00:00 2001 From: Uber Veng Date: Fri, 29 May 2026 05:37:35 +0700 Subject: [PATCH] install script update --- install.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/install.sh b/install.sh index 2961b1c..6c38265 100755 --- a/install.sh +++ b/install.sh @@ -84,34 +84,28 @@ ok "Installed → $INSTALL_DIR/$BINARY" # ── Add ~/.local/bin to PATH if missing ────────────────────────────────────── if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then - warn "$INSTALL_DIR is not in PATH — adding it now..." + export PATH="$INSTALL_DIR:$PATH" EXPORT_LINE="export PATH=\"\$HOME/.local/bin:\$PATH\"" - # Determine which profile file to update - if [ -f "$HOME/.bashrc" ]; then + if [ -f "$HOME/.zshrc" ]; then + PROFILE="$HOME/.zshrc" + elif [ -f "$HOME/.bashrc" ]; then PROFILE="$HOME/.bashrc" elif [ -f "$HOME/.bash_profile" ]; then PROFILE="$HOME/.bash_profile" elif [ -f "$HOME/.profile" ]; then PROFILE="$HOME/.profile" else - # Create .bashrc if nothing exists PROFILE="$HOME/.bashrc" fi - # Avoid duplicate entries if ! grep -qF "$INSTALL_DIR" "$PROFILE" 2>/dev/null; then printf '\n# Added by ostiary installer\n%s\n' "$EXPORT_LINE" >> "$PROFILE" ok "Added PATH entry to $PROFILE" fi - - warn "Run the following to use ostiary in this session:" - warn " export PATH=\"\$HOME/.local/bin:\$PATH\"" - warn "New shells will pick it up automatically." -else - ok "$INSTALL_DIR is already in PATH" fi echo "" -ok "Done! Run: $BINARY" +ok "Launching ${BINARY}..." +exec "$INSTALL_DIR/$BINARY"