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

Is it possible to allow '~/' in path? #1

Closed
zizther opened this issue Oct 23, 2015 · 2 comments
Closed

Is it possible to allow '~/' in path? #1

zizther opened this issue Oct 23, 2015 · 2 comments

Comments

@zizther
Copy link

zizther commented Oct 23, 2015

I am looking to use '~/.docker/config.json' as the file path but it does not work. If i use an absolute path it works fine.
At the moment I am using $HOME in a shell.exec function, which feels a bit messy. Unless this is the right way.

What is the best way to handle using '~' in the path, or will this never be possible?

@vyp
Copy link

vyp commented Oct 23, 2015

I think nodejs/node#684 is the relevant issue to reference. And do remember that the tilde is just a shell feature (in bash, zsh etc).

@sindresorhus
Copy link
Owner

This should really be in Node.js core, but they seem unwilling: nodejs/node#684

You can use https://github.com/sindresorhus/untildify to expand the tilde.

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

No branches or pull requests

3 participants