Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
legeana opened this issue May 26, 2023 · 3 comments
Open
Labels
enhancement New feature or request
Milestone

Comments

@legeana
Copy link

legeana commented May 26, 2023

Currently fisher install FOO always fetches FOO.

Proposal

It would be convenient to have a command like

  • fisher install_missing FOO, or
  • fisher install_needed FOO

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
Copy link
Owner

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.

@jorgebucaran jorgebucaran added this to the 5.0 milestone May 27, 2023
@jorgebucaran jorgebucaran added the enhancement New feature or request label May 27, 2023
@j-lakeman
Copy link

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants