goshatch / orgroam_to_obsidian

Convert an org-roam notes collection to markdown for Obsidian
17 stars 8 forks source link

Possible bug: issue with file names with spaces #2

Closed bevan-philip closed 11 months ago

bevan-philip commented 1 year ago

Within my org-roam directory, I had a file named "roam/blog/CS scouting.org". However, until I removed the file, the conversion would fail with the following error.

/Users/bevan/.gem/ruby/3.1.3/gems/pandoc-ruby-2.1.7/lib/pandoc-ruby.rb:306:in `execute': **pandoc: input/roam/blog/CS: withBinaryFile: does not exist (No such file or directory) (****RuntimeError****)**

from /Users/bevan/.gem/ruby/3.1.3/gems/pandoc-ruby-2.1.7/lib/pandoc-ruby.rb:275:in `execute_pandoc'

from /Users/bevan/.gem/ruby/3.1.3/gems/pandoc-ruby-2.1.7/lib/pandoc-ruby.rb:269:in `convert_string'

from /Users/bevan/.gem/ruby/3.1.3/gems/pandoc-ruby-2.1.7/lib/pandoc-ruby.rb:205:in `convert'

from /Users/bevan/.gem/ruby/3.1.3/gems/pandoc-ruby-2.1.7/lib/pandoc-ruby.rb:241:in `block (2 levels) in <class:PandocRuby>'

from ./convert.rb:38:in `input_file_to_md'

from ./convert.rb:16:in `initialize'

from ./convert.rb:60:in `new'

from ./convert.rb:60:in `block in initialize'

from ./convert.rb:59:in `each'

from ./convert.rb:59:in `initialize'

from ./convert.rb:95:in `new'

from ./convert.rb:95:in `<main>'

This error was an issue on both macOS and Ubuntu.

I've worked around this bug by simply creating a new note, and copying the contents (I'm sure re-naming and re-creating the database would have also worked), so probably don't invest too much energy here 😄 .

CharlesEkkel commented 1 year ago

@arrivance I had the same issue! I managed to fix it by escaping the whitespace for each file name when querying the database, see my PR: #5.

Although sounds like you're all sorted now :smile:

goshatch commented 11 months ago

Going to close this as it seems there's a solution, and also a fix from @CharlesEkkel (thank you).