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

Auto create missing directories when symlinking #227

Closed
1 task done
boldandbrad opened this issue Dec 28, 2024 · 1 comment · Fixed by #228
Closed
1 task done

Auto create missing directories when symlinking #227

boldandbrad opened this issue Dec 28, 2024 · 1 comment · Fixed by #228
Assignees

Comments

@boldandbrad
Copy link
Contributor

Code of Conduct

  • I agree to follow this project's Code of Conduct

What would you like to see changed/added?

Problem

Currently, given a file tree like:

~/.config/
    foo/foo.conf

And an aliae.yaml like:

link:
  - name: ~/.config/bar/bar.conf
    target: path/to/bar.conf

Upon shell startup the following error will be produced:

ln: .../.config/bar/bar.conf: No such file or directory

This is because ln cannot create a symbolic link in the bar directory since it doesn't exist.

Solution

It might be nice to have check that automatically creates these intermediate directories when attempting to symlink if they don't exist.

Not sure if the same limitation exists for cmd or powershell on windows as I do not use them personally.

I'm willing to put up a PR for this after the new year when I get some time if you don't beat me to it :)

@JanDeDobbeleer
Copy link
Owner

It might be nice to have check that automatically creates these intermediate directories when attempting to symlink if they don't exist.

@boldandbrad while I could argue this goes beyond the scope of the project, I don't mind adding this but not as the default behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants