jorgebucaran / fisher

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

fix: ignore .curlrc file when downloading plugin's tarball #771

Closed ZuBB closed 10 months ago

ZuBB commented 10 months ago

When .curlrc contains -O option, curl saves file to disk instead of redirecting it to stdout. thats why tar fails at next step as there is noting to extract

jorgebucaran commented 10 months ago

This might mess things up or break stuff, but not sure how bad. Maybe we should go for something like fisher_curl_flags instead? Thoughts?

ZuBB commented 10 months ago

Two thoughts related to your comment

This might mess things up or break stuff

I am sorry, but between "might" and "already" I would choose to fix bugs that already exist. "might" may end as "nothing wrong happened".

What fisher needs is to download a file. Downloading a file (through HTTP proto) is a pretty routine operation within a system. As a rule, there are several tools/apps in a system that work with HTTP. So it is hardly imaginable that each of that apps has its own HTTP settings that make download/"serve" actually work. And even if that is the case, I would say that particular system/setup is more screwed than mine with -O in .curlrc.

Maybe we should go for something like fisher_curl_flags instead?

I am not sure I get your idea. Can you give a bit more details?

ZuBB commented 10 months ago

This might mess things up or break stuff, but not sure how bad

on the contrary: can you come up with the craziest example of the harm that might happen when a fisher tries to download a file for itself with the help of curl and not using the (user's) .curlrc file?

I am just trying to assess what mess we can bring with this change

jorgebucaran commented 10 months ago

Can't think of one yet. Let's skip .curlrc then. For now, stick to the single-letter version of the flag. We can switch to the long version in a separate commit later.

ZuBB commented 10 months ago

Should I replace all flags with their single letter versions?

ZuBB commented 10 months ago

-qsl or -q -s -l?

jorgebucaran commented 10 months ago

No, only the ones you've made changes to. What's the short version of --disable?

jorgebucaran commented 10 months ago

We can go for the longer versions later. I just want to keep this commit separate.

ZuBB commented 10 months ago

No, only the ones you've made changes to. What's the short version of --disable?

-q

ZuBB commented 10 months ago

Sorry, I am not sure what to do here. Replace "disable" with "q"?

jorgebucaran commented 10 months ago

Why did you change -L for --location?

ZuBB commented 10 months ago

I just thought that it would be better (more descriptive) to have the full version of the flags instead of a short one. I am OK with either. Should I put -L back?

jorgebucaran commented 10 months ago

Yes

ZuBB commented 10 months ago

and which for you prefer for "disable"? short or full one?

jorgebucaran commented 10 months ago

Use the long one. I'll be using long ones for all flags later on, but I want to keep this commit separate.

ZuBB commented 10 months ago

Done. If you need it squashed -- let me know

jorgebucaran commented 10 months ago

Hey, thinking it over, let's roll with -q. I was checking out the curl 7.49.0 release notes and saw:

curl: make --disable work as long form of -q

Looks like -q was around before --disable, and some users might still be on an earlier curl.

ZuBB commented 10 months ago

Done

ZuBB commented 10 months ago

I have a bit off-top q: what happens with the content of fish_plugins files when I run the install command? For example, I need to bootstrap my env after moving to a new machine and the subject file arrived through cloned dotfiles. plain overwrite or any kind of smart action(s)?

jorgebucaran commented 10 months ago

If you've moved to a new machine and cloned your dotfiles, running fisher install should set up your plugins as per your previous machine, using the fisher_plugins file as a reference.

ZuBB commented 10 months ago

running fisher install

before running that command I need to get fisher itself. so after installing fisher itself file will be preserved, updated, or overwritten?

jorgebucaran commented 10 months ago

Well, to bootstrap, you first install Fisher using our installation script:

curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher

The script directly sources and then installs Fisher from GitHub. It does this because Fisher isn't already in your ~/.config/fish/functions or its universal state.

For plugin updates, Fisher replaces old files with new ones and removes any outdated files from the plugin.

ZuBB commented 10 months ago

thank you for the response. and thanks a lot for your work as fisher's maintainer