Skip to content

fix(installer): robust shell detection and fish-safe PATH update#75

Open
Dwsy wants to merge 1 commit intoRightNow-AI:mainfrom
Dwsy:fix/install-shell-detection
Open

fix(installer): robust shell detection and fish-safe PATH update#75
Dwsy wants to merge 1 commit intoRightNow-AI:mainfrom
Dwsy:fix/install-shell-detection

Conversation

@Dwsy
Copy link

@Dwsy Dwsy commented Feb 28, 2026

Summary

  • add robust shell detection for installer using priority: OPENFANG_SHELL -> $SHELL -> parent process -> grandparent process
  • fix fish PATH injection to use fish_add_path instead of POSIX export PATH=... syntax
  • keep bash/zsh/sh behavior unchanged (export PATH=...)
  • fallback profile handling for unknown shells (~/.profile)

Why

When users run curl -fsSL https://openfang.sh/install | sh from fish, shell detection can be ambiguous and PATH lines must be fish-native. Using POSIX export syntax in fish can break PATH and hide core commands.

Validation

  • bash -n scripts/install.sh
  • fish context check with parent-shell fallback (fish -c, SHELL=/bin/sh)
    • detected shell = fish
    • profile = ~/.config/fish/config.fish
  • explicit override checks (OPENFANG_SHELL=fish|zsh)
  • end-to-end local install test with isolated HOME:
    • fish writes fish_add_path "<install_dir>" to fish config
    • bash writes export PATH="<install_dir>:$PATH" to bash profile

Scope

No platform download/extract logic changed. Linux/macOS target resolution remains untouched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant