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

Doesn't recognize shell meta-characters in file path #12

Closed
ankush981 opened this issue Nov 28, 2018 · 3 comments
Closed

Doesn't recognize shell meta-characters in file path #12

ankush981 opened this issue Nov 28, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@ankush981
Copy link

When passing the CSV path an a string, qsv doesn't seem to recognize the tilde "~" character on Linux (Ubuntu 18.04). Here's the command history to show how to reproduce the bug:

qsv$ node bin/qsv.js -p "~/Desktop/data.csv" -h
{ [Error: ENOENT: no such file or directory, open '~/Desktop/data.csv']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '~/Desktop/data.csv' }
(node:16684) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be one of type string or Buffer. Received type object
    at validChunk (_stream_writable.js:258:10)
    at WriteStream.Writable.write (_stream_writable.js:292:21)
    at start (/media/common/code/projects/github/qsv/bin/qsv.js:23:20)
(node:16684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:16684) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
qsv$ node bin/qsv.js -p "/home/ankush/Desktop/data.csv" -h
QSV>
@herrfugbaum
Copy link
Owner

Thanks for the report!

Afaik node.js doesn't expand meta characters automatically see nodejs/node#684

But there is a package linked in the issue that looks promising: untildify

@herrfugbaum herrfugbaum added the bug Something isn't working label Nov 28, 2018
@ankush981
Copy link
Author

Damn. I saw something interesting in the link you shared: nodejs/node#684 (comment). But then, who knows what other characters we might encounter later!

@herrfugbaum
Copy link
Owner

I just tested the version of #14 with ~ and $ and it seems to work

test=path/to/file.csv

node bin/qsv.js -p ~/$test

default

I don't know if there are more meta characters of interest.
If we find some it's probably best to open an issue/pr on the untildify repo.
What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants