handle home directory expansion
currently if you supply a path with a tilde character, you get a runtime panic. I added a function to simply replace ~ with the home directory. It adds one dependency, though one maintained by the cargo team. This could be done without adding another dependency, though using a deprecated function std::env::home_dir()(which honestly the dependency is just calling and handling the edge cases not handled).
If you want me to change anything, let me know.
Truthfully, I'm quite on the fence about this. Path expansion should be the responsibility of the user's shell in my opinion, and allowing homedir/tilde expansion would open up the door to other similar requests in the future.
Truthfully, I'm quite on the fence about this. Path expansion should be the responsibility of the user's shell in my opinion, and allowing homedir/tilde expansion would open up the door to other similar requests in the future.
fair, though the reason I opened the PR was because I ran into an edge case where the ~ character wasn't expanded: the path was in an env variable being used in a bash script, and in this situation, the path wasn't expanded. I suppose it might be better to handle within that shell script, given there are situations this doesn't cover (like ~foo to expand to /home/foo).
If you would rather not merge that's totally fine.