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

Dereference links on install #740

Merged

Conversation

carlfriedrich
Copy link
Contributor

@carlfriedrich carlfriedrich commented Oct 8, 2022

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

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

@carlfriedrich
Copy link
Contributor Author

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

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

@carlfriedrich
Copy link
Contributor Author

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

@carlfriedrich On macOS it reads:

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

@carlfriedrich
Copy link
Contributor Author

@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
Copy link
Contributor Author

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

@jorgebucaran jorgebucaran added the enhancement New feature or request label Oct 13, 2022
@jorgebucaran jorgebucaran merged commit 53c06c9 into jorgebucaran:main Oct 13, 2022
@jorgebucaran
Copy link
Owner

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

@carlfriedrich carlfriedrich deleted the dereference-links-on-install branch October 13, 2022 17:25
@carlfriedrich
Copy link
Contributor Author

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

@jorgebucaran
Copy link
Owner

You bet! Should be good now.

@carlfriedrich
Copy link
Contributor Author

Yaaaay! 🥳 Thanks a lot for your quick support!

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

Successfully merging this pull request may close these issues.

None yet

2 participants