Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expand ~ to the current user's home directory for cli options.

See original GitHub issue

So something like eslint --config="~/.eslintrc" --ignore-dir="~/eslintignore" --rulesdir="~/.config/eslint/rules" --output="~/output" works as expected and uses files in the user’s home directory.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

michaelficarracommented, Jun 6, 2015

@tupton I don’t know of a single GNU util (or any other program) that will expand a literal ~ for you. They all let you work with a directory named ~. Expanding it would be a surprising feature.

$ mkdir "~"
$ touch "~/file"
$ cd "~/.."
$ rm "~/file"
$ rmdir "~"
tuptoncommented, Jun 6, 2015

Fair enough. I think it can be expected that users who have paths beginning with “~” have to perform this expansion before giving the directory to eslint, whether by their shell or otherwise. Thanks for taking the time to look at this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get $HOME directory when switching to a different user ...
Very good idea to let bash do it! Another alternative for current user home is: eval echo "~$(who -m | awk '{ print...
Read more >
How can I retrospectively create a default home directory for ...
If you want to create the user's home directory if it does not exist, then run the useradd command with the -m flag....
Read more >
Why tilde (~) doesn't expand when used with CLI argument ...
If you want to ensure that the home directory path of the current user is properly expanded as part of an argument to...
Read more >
OperatingSystem - Robot Framework
Paths beginning with ~ or ~username are expanded to the current or specified user's home directory, respectively. The resulting path is ...
Read more >
Get home directory by username - linux - Super User
If the user's home folder is different the second time, this command gives the original home folder rather than the current one. glenn...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found