jorgebucaran / fisher

A plugin manager for Fish
https://git.io/fisher
MIT License
7.53k stars 257 forks source link

Feature request: Flag to stop fisher resourcing config.fish #778

Closed HawkinsT closed 7 months ago

HawkinsT commented 7 months ago

Whenever fisher is run it sources config.fish. In general this is good, however I have my config.fish set to look for fisher and install it (as well as a specified list of fisher plugins). Unfortunately, this leads to endless loops requiring a hacky work around (since fisher is self-installing and so keeps resourcing config.fish).

MWE of what's required to avoid this:

if not test -f ~/.config/fish/startup.fish_sourced
    touch ~/.config/fish/startup.fish_sourced
    # Install fisher if it's not found
    if not type -q fisher
        curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
    end
end
if test -f ~/.config/fish/startup.fish_sourced
    rm ~/.config/fish/startup.fish_sourced
end

Given this use case, can a flag please be added to fisher that will stop config.fish being resourced on command completion, e.g. fisher -N install jorgebucaran/fisher or fisher install jorgebucaran/fisher --no-reload.

jorgebucaran commented 7 months ago

You can achieve your goal cleanly using the status is-interactive command in Fish.

if status is-interactive
    # ...
end
HawkinsT commented 7 months ago

Oh, wow. I guess I should have been aware of this but thanks a lot! Sorry for the poor feature request.