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

[BUG] Unable to use absolute path for User Library folder (~/Library) on macOS #265

Open
peterkos opened this issue Feb 19, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@peterkos
Copy link

peterkos commented Feb 19, 2024

Describe the bug
According to the quick start docs:

# A dot entry representing a symlink, `source` is relative to `dotfiles_dir`
# and `target` shall be relative to $HOME directory or absolute.
sway = { source = "sway", target = ".config/sway" }

I'd expect the tilde to be inferred as an absolute path (as it's a shortcut for /Users/username), but instead it is rendered relativey, from the User directory.

To Reproduce

  1. Create a profile with the following setting:
[profiles.sublime.dots.keymap]
source = "configs/sublime/Default.sublime-keymap"
target = ["~/Library/blah"]
  1. Run bombadil link -p sublime
  2. Observe symlink creation error for /Users/username/~/Library/blah

Expected behavior
Above, ["~/Library/blah"] is respected as a root path, not a relative path to $HOME

  1. Run bombadil link -p sublime with the above config
  2. Symlink created as expected for ~/Library/blah

Additional context
The current workaround is to specify Library as a relative path target = "Library/blah" to reference the user path, but imo it's a little confusing. Since target supports absolute or relative paths, I find it tricky to infer:

Path Note
Library Probably a relative path?
.Library Definitely a relative path
/Library Definitely a root path
~/Library ⚠️ Should be an absolute path (but is rendered relative!)
/~/Library ⚠️ Should be an absolute path

tl;dr, I believe ~/Library should be absolute, not rendered relatively :) def open to thoughts though!

@peterkos peterkos added the bug Something isn't working label Feb 19, 2024
@shaleh
Copy link

shaleh commented Mar 4, 2024

If ~/ is the default why are you adding ~/??
If you just HAVE to have an absolute path, why not use the real path instead of the ~? Like /home/foo or /Users/foo/ or whatever.

@peterkos
Copy link
Author

peterkos commented Mar 4, 2024

If ~/ is the default why are you adding ~/??

That's not always true, which is why I'm filing this bug :)
The docs say "target shall be relative to $HOME directory or absolute" -- it's ambiguous if it will be absolute or home.

(And, it's macOS UNIX convention to use ~ as a shortcut to $HOME)

(Does that make sense? I might be misreading)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants