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

feat: new command hardlink #1268

Merged
merged 3 commits into from
Jul 10, 2024
Merged

feat: new command hardlink #1268

merged 3 commits into from
Jul 10, 2024

Conversation

Ape
Copy link
Contributor

@Ape Ape commented Jul 6, 2024

Implementation for #1258.

I hope adding walkdir as a dependency is okay.

@Ape Ape mentioned this pull request Jul 6, 2024
1 task
@Ape Ape changed the title WIP: Add '--hard' option to 'link' command Add '--hard' option to 'link' command Jul 6, 2024
@Ape
Copy link
Contributor Author

Ape commented Jul 6, 2024

I have only tested this on Linux, but my understanding is that it should work regardless of the OS.

yazi-scheduler/Cargo.toml Outdated Show resolved Hide resolved
@Ape Ape requested a review from sxyazi July 7, 2024 04:27
yazi-scheduler/src/file/file.rs Outdated Show resolved Hide resolved
@sxyazi
Copy link
Owner

sxyazi commented Jul 9, 2024

I've thought about it, and it's better to implement it as a new command hardlink, because I found some logic in link is redundant (like getting the relative path, which doesn't apply to hardlinks).

I'll finish the remaining work on this PR.

@sxyazi sxyazi changed the title Add '--hard' option to 'link' command feat: new command hardlink Jul 10, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 10, 2024

I did some tests and it looks great even when hardlinking to a broken softlink (points to a file don't exist). I think we can merge it now.

@sxyazi sxyazi merged commit 5df580e into sxyazi:main Jul 10, 2024
6 checks passed
sxyazi added a commit that referenced this pull request Jul 10, 2024
@Ape Ape deleted the pr/hardlink branch July 10, 2024 08:13
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants