jorgebucaran / fisher

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

Dereference links on install #740

Closed carlfriedrich closed 1 year ago

carlfriedrich commented 1 year ago

I have a plugin which shares code for zsh and fish. I'd like to symlink this shared code file to the functions directory within the git repository, so that it gets installed by fisher. Unfortunately fisher does not dereference links and hence installs a broken link in this case.

This PR adds the -L argument to cp in order to dereference links on install and update.

jorgebucaran commented 1 year ago

Cool! What does dereferencing mean? Will this affect how we install other plugins?

carlfriedrich commented 1 year ago

Cool! What does dereferencing mean?

It means: "If the file to be copied is a symbolic link, do not copy the link, but the file it points to instead."

Will this affect how we install other plugins?

It will affect symbolic links only. The installation of plugins containing regular files (which I assume are all existing plugins to date) won't change at all.

jorgebucaran commented 1 year ago

Thanks! Do you know if -L is portable alright?

carlfriedrich commented 1 year ago

At least it's part of GNU coreutils since 22 years and busybox since 14 years, so I would assume so. Do you know if there are any other cp variants?

jorgebucaran commented 1 year ago

@carlfriedrich On macOS it reads:

-L    If the -R option is specified, all symbolic links are followed.
carlfriedrich commented 1 year ago

@carlfriedrich On macOS it reads:

-L    If the -R option is specified, all symbolic links are followed.

Great, that's exactly what it's supposed to do.

carlfriedrich commented 1 year ago

@jorgebucaran So will you merge this or are there any doubts left?

jorgebucaran commented 1 year ago

Yes, of course! Sorry to keep you waiting and thanks! 🙌

carlfriedrich commented 1 year ago

@jorgebucaran Great, thanks a lot! ❤️ Do you have plans for an upcoming release containing the patch?

jorgebucaran commented 1 year ago

You bet! Should be good now.

carlfriedrich commented 1 year ago

Yaaaay! 🥳 Thanks a lot for your quick support!