You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
path.isAbsolute return false for ~ on Ubuntu #29164
I'm checking if given path in config file is absolute or relative. It works great however not when ~ is used. Then it returns false.
Here is my code
importpathfrom'path';path.isAbsolute('/var/www/index.html');// truepath.isAbsolute('./index.html');// falsepath.isAbsolute('~/Documents/test.json');// false - THIS IS BAD
Activity
cjihrig commentedon Aug 16, 2019
The problem is that the
pathmodule doesn't know anything about expanding the~(that's a shell thing).bnoordhuis commentedon Aug 16, 2019
As Colin mentions, the
pathmodule doesn't do shell expansion. Closing, not a bug.arxeiss commentedon Aug 19, 2019
Sorry guys, my fault. I always thought that
~is regular path descriptor for Linux, not a shell thing.