Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand a path string prefixed with ~/ to the current user's home directory. Example: if current user is `user1` with home directory in `/home/user1`, then `~/project` -> `/home/user1/project` It's useful to allow paths with `~/`, so that `direnv.toml` can be reused via dotfiles repos across systems with different standard home paths (compare Linux `/home` and macOS `/Users`). Feedback is welcome e.g. if/how this should be tested. For now manual testing of prefix & exact has been done confirming that full paths as well ass `~/`-paths works. I looked here for how to expand tilde: https://gist.github.com/miguelmota/9ab72c5e342f833123c0b5cfd5aca468 I also found a third party module that expands tilde https://github.com/prep/tilde that we can swap in instead of the `expandTildePath` method in this PR if desired. I assumed the project would like to minimize dependencies and made this simple function instead. Fixes #926
- Loading branch information