jorgebucaran / fisher

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

Feature request: add a command to only install packages that are missing #763

Open legeana opened 1 year ago

legeana commented 1 year ago

Currently fisher install FOO always fetches FOO.

Proposal

It would be convenient to have a command like

that would only download FOO if it's not already installed.

I am currently using a workaround below, but I feel it could be a nice feature to have in fisher.

function fisher_install_needed
    set -l installed (fisher list)
    set -l needed
    for i in $argv
        if ! contains $i $installed
            set -a needed $i
        end
    end
    if count $needed >/dev/null
        fisher install $needed
    end
end

Use case

This can be convenient if you want to only download plugin if necessary, but don't really want to check for updates every time. For example, in my automated dotfiles setup I like having idempotent commands that don't do unnecessary downloads. I prefer triggering expensive updates not as frequently.

jorgebucaran commented 1 year ago

Perhaps that's how the fisher install command should work to start with. If someone wants to update a plugin, they can simply use fisher update. It would make the workflow more intuitive.

This could go into Fisher 5. I just want to make sure that it doesn't have any unintended consequences.

j-lakeman commented 1 month ago

Any updates on this @jorgebucaran? Would also love to see this actually! IMHO fisher update should also only update outdated plugins in order to avoid unnecessary downloads like @legeana pointed out.

jorgebucaran commented 1 month ago

No updates have been made because this issue is not trivial, a blocker or significant. For those who may not understand what's being asked: Fisher's install/update strategy is to overwrite plugins, whether or not an actual update exists. I've never encountered an issue with this.

The OP suggests that Fisher should only install or update if the plugin is not already installed or needs updates. In practice, this is not trivial and for interactive use, the benefit is nearly non-existent since installs/updates happen almost instantly.

I mentioned that I would consider this for Fisher 5, but we're stable right now, so I don't have a roadmap for that.

Thanks for checking in.