install script update

This commit is contained in:
Uber Veng
2026-05-29 05:37:35 +07:00
parent a9aa0ad736
commit fdc9219742

View File

@@ -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"