Skip to content

feat: ~/ replacement with home dir using dirs #239

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

Merged
merged 2 commits into from
Jun 17, 2025
Merged

Conversation

RobertMueller2
Copy link
Collaborator

Closes #63

Simple implementation, decided against shellexpand because it seems unmaintained, whereas dirs moved its repository but seems maintained.

Suggest followup issue for further replacements discussions, this probably requires to move everything out of handle_save().

Somebody should test this on Windows, if Satty ever runs there ;)

Closes gabm#63

Simple implementation, decided against shellexpand because it seems
unmaintained, whereas dirs moved its repository but seems maintained.

Suggest followup issue for further replacements discussions, this
probably requires to move everything out of `handle_save()`.

Somebody should test this on Windows, if Satty ever runs there ;)
@gabm
Copy link
Owner

gabm commented Jun 8, 2025

we already have a dependency for xdg dirs.. could we only use one?

@RobertMueller2
Copy link
Collaborator Author

Well, I don't feel like changing the other places.

std::env::home_dir() should be a reasonable replacement, though, it even has fallback. Perhaps it's best to use just that.

@fabienjuif
Copy link
Collaborator

Create an issue maybe @RobertMueller2 (to migrate to XDG?)
Until then, I think this PR is creating value so I am ✅ and let you decide if we merge (I vote for a merge if it was not clear)

@RobertMueller2
Copy link
Collaborator Author

Create an issue maybe @RobertMueller2 (to migrate to XDG?) Until then, I think this PR is creating value so I am ✅ and let you decide if we merge (I vote for a merge if it was not clear)

For the home dir, I don't think using xdg adds any value over std. So I'd probably leave it at that in this code place. Std should always be ok, IMO.

I think @gabm was against using both xdg AND dirs as the latter also provides xdg paths, which is a valid concern. And for that, replacing the existing code bits using xdg with dirs, well, felt a bit pointless :)

@gabm
Copy link
Owner

gabm commented Jun 17, 2025

  • yes, I meant what @RobertMueller2 said, he removed the new dependency and relied on std-lib stuff.. great!
  • replacing xdg-directories might not be necessary, it just works ™️; therefore a new issue is not needed
  • fyi: std::env::home_dir had been deprecated until rust 1.85 where it was "undeprecated" .. so its a future-proof way forward; via ACP: env::home_dir replacement rust-lang/libs-team#372

@gabm gabm merged commit 2ce8688 into gabm:main Jun 17, 2025
3 checks passed
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 this pull request may close these issues.

Support for ~/ in output dir
3 participants