jorgebucaran / fisher

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

Add flag for forcing plugin installation #725

Closed ghost closed 2 years ago

ghost commented 2 years ago

I was thinking of adding something like a -f flag for forcing the update/installation of a given plugin

My use case is that i already have a local copy of fisher.fish on functions/, but i want to keep it updated with fisher update instead of having to manually fetch new versions, i've even added it to my fisher_plugins file

But whenever i try to update it, i get the following error:

fisher: Cannot install "jorgebucaran/fisher.fish": please remove or move conflicting files first

When using the -f flag, these files would be forcefully removed/overwritten and the plugin would be installed normally

jorgebucaran commented 2 years ago

@henriquehbr I don't understand your use case. Why aren't you using Fisher to install or update Fisher already?

ghost commented 2 years ago

I am trying to use fisher to update itself, but why can't the plugin be overwritten when needed to? for example, i manually copied version 4.4.2 of fisher to my functions/ directory, but now i want to keep it updated whenever you make a new release, i know that i can just leave the plugin name on fish_plugins and run:

curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher

to install fisher, as suggested on the docs, but what if i want to keep a local copy instead of having to fetch one through curl?

Another good analogy would be like when you install a specific version of a linux distro, it comes with a set of packages that were considered to be at the latest version at the time this distro version was released, but now, at the time of installation, you might need to update them

Correct me if i'm wrong, but from what i've saw, this doesn't seem to be something complex, neither something that would add a lot of bloat to the codebase, as we would simply verify if -f was passed when updating/installing a fish plugin, and overwrite the conflicting files instead of having to do this manually

jorgebucaran commented 2 years ago

i manually copied version 4.4.2 of fisher to my functions/ directory...

Why?

ghost commented 2 years ago

For cases when i'm setting up my dotfiles but i don't have internet access, even though it might seem pointless as some of the basic fisher operations like installing and updating plugins requires internet, things like listing and removing don't

jorgebucaran commented 2 years ago

Without internet access, fisher update jorgebucaran/fisher should simply fail to update Fisher.

Why can't you install Fisher using the provided instructions, and update it via fisher update jorgebucaran/fisher?

ghost commented 2 years ago

I usually prefer to avoid sourcing scripts installed from the internet through curl for security purposes, for me, i find it better to keep a local copy which i'm already sure of it's contents

Without internet access, fisher update jorgebucaran/fisher should simply fail to update Fisher.

As i previously stated, even though updating and installation of plugins would fail, i still want to keep it there, functional and set up for when i'm able to get internet, instead of waiting for a connection, and just then updating fisher with fisher update -f jorgebucaran/fisher

It's like saying that fisher list is not a necessary feature when you can just cat fish_plugins

jorgebucaran commented 2 years ago

In that case, you could clone this repo and install Fisher as a local plugin.