iandol / scrivomatic

A writing workflow using Scrivener's style system + Pandoc for output…
https://iandol.github.io/scrivomatic/
GNU General Public License v3.0
297 stars 30 forks source link

Scrivomatic fails to process files with spaces in the name #12

Closed oWretch closed 6 years ago

oWretch commented 6 years ago

Hi Ian,

I've noticed that Scrivomatic is not happy when passed an input file with a space in the name (e.g., My File.md). It doesn't matter if I escape the space with \, or enclose the name in double quotes. Either way, Scrivomatic fails with

!!!---Scrivomatic: could not find My\ File.tex

Is it possible to add support for file names with spaces?

iandol commented 6 years ago

OK, let me have a look at this, it should be able to handle this (I use a ruby shell library to do this but I may be doing something wrong somewhere else)...

iandol commented 6 years ago

@oWretch — Hi, I can't actually reproduce this, if I use:

❯ scrivomatic -v Behaviour\ Platform.txt

I get the input properly escaped. I am using the ShellWords library on all input and it should properly handle spaces whether they are escaped or not. I also tried:

❯ scrivomatic -v "Behaviour Platform.txt"
❯ scrivomatic -v -i Behaviour\ Platform.txt
❯ scrivomatic -v -i "Behaviour Platform.txt"

They also all worked. Perhaps you are using an older scrivomatic or ruby? Please let me know what version of ruby (ruby -v) and scrivomatic (scrivomatic -h) you are using...

iandol commented 6 years ago

I'll go ahead and close this, do let me know if you still see it and we can reopen...

oWretch commented 6 years ago

It's working correctly for me now after updating to 498ea96.

Thanks Ian.