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

Error when passing file with spaces #89

Closed
flight16 opened this issue Nov 19, 2015 · 1 comment · Fixed by #248
Closed

Error when passing file with spaces #89

flight16 opened this issue Nov 19, 2015 · 1 comment · Fixed by #248
Labels

Comments

@flight16
Copy link

Works:

doctoc . 

Doesn't work:

doctoc "A Document.md"
C:\Users\flight16\Documents\Work\3 Projects (Current)\>doctoc "A Document.md"
fs.js:892
  return binding.stat(pathModule._makeLong(path));
                 ^
Error: ENOENT: no such file or directory, stat 'C:\Users\flight16\Documents\Work\3 Projects (Current)\A\ Document.md'
    at Error (native)
    at Object.fs.statSync (fs.js:892:18)
    at Object.<anonymous> (C:\Users\flight16\AppData\Roaming\npm\node_modules\doctoc\doctoc.js:90:17)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:138:18)
    at node.js:974:3

Removing "return homeExpanded.replace(/\s/g, '\ ');" from doctoc.js worked fixed the issue.

Shouldn't the program trust the user to pass the filename correctly?

@jez
Copy link
Collaborator

jez commented Nov 20, 2015

@thlorenz I'm inclined to agree. I looked up when this line made it into the codebase, and it seems like it was added purposefully (commit 994839f: renaming and fixed path resolution).

Any idea what's up with this? It'd be simple to take it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants