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

Command for creating hard links #1258

Closed
1 task done
Ape opened this issue Jul 4, 2024 · 5 comments
Closed
1 task done

Command for creating hard links #1258

Ape opened this issue Jul 4, 2024 · 5 comments
Labels
feature New feature request good first issue Good for newcomers

Comments

@Ape
Copy link
Contributor

Ape commented Jul 4, 2024

Please describe the problem you're trying to solve

I'd like to have a keymappable command for creating a hard link of the yanked file. In case of multiple files or directories, I'd like it to create the directories and hard links for all of them in a tree structure.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

hardlink command would be similar to link.

Additional context

No response

@Ape Ape added the feature New feature request label Jul 4, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 5, 2024

Nice to have, maybe we can add a --hard to the existing link command, i.e. link --hard.

Anyone want to give it a go? We need to add the hard argument to the link command here:

pub struct Opt {
relative: bool,
force: bool,
}

And this should be the only place we need to change in the scheduler:

#[cfg(unix)]
{
fs::symlink(src, &task.to).await?
}
#[cfg(windows)]
{
if meta.is_dir() {
fs::symlink_dir(src, &task.to).await?
} else {
fs::symlink_file(src, &task.to).await?
}
}

@sxyazi sxyazi added the good first issue Good for newcomers label Jul 5, 2024
@Ape
Copy link
Contributor Author

Ape commented Jul 6, 2024

I have a work-in-progress patch here: #1268

I still want to add support for directories.

Ape added a commit to Ape/yazi that referenced this issue Jul 6, 2024
@Ape
Copy link
Contributor Author

Ape commented Jul 6, 2024

The pull request is now ready for review.

I also added an optional second commit for adjusting the default keymap. This is how I would configure the keys, but I understand that my opinion might differ from other people.

Ape added a commit to Ape/yazi that referenced this issue Jul 7, 2024
Ape added a commit to Ape/yazi that referenced this issue Jul 7, 2024
Ape added a commit to Ape/yazi that referenced this issue Jul 8, 2024
Ape added a commit to Ape/yazi that referenced this issue Jul 9, 2024
Ape added a commit to Ape/yazi that referenced this issue Jul 9, 2024
Ape added a commit to Ape/yazi that referenced this issue Jul 9, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 10, 2024

Done in #1268

@sxyazi sxyazi closed this as completed Jul 10, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳
This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@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
feature New feature request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants