babluboy / bookworm

A simple ebook reader for Elementary OS
GNU General Public License v3.0
1.32k stars 100 forks source link

No books are discovered due to whitespace in find command #288

Closed an0nfunc closed 4 years ago

an0nfunc commented 4 years ago

Commit https://github.com/babluboy/bookworm/commit/b88d671d50d5fcec4bc6981c3e7354c6cd904887 changed the find command that's issued to discover books in a folder from ! -readable -prune -o -type f \\( -iname \\*.mobi -o -iname \\*.pdf -o -iname \\*.epub -o -iname \\*.cbr -o -iname \\*.cbz \\) -print to ! -readable -prune -o -type f \\ ( -iname \\*.mobi -o -iname \\*.pdf -o -iname \\*.epub -o -iname \\*.cbr -o -iname \\*.cbz \\) -print.

File related: https://github.com/babluboy/bookworm/blob/df586ed2b8aa0659b88781f7ad4add9b1af71ce4/src/backgroundTasks.vala#L63

This renders that command unusable, exiting with

(com.github.babluboy.bookworm:124924): WARNING : 15:46:10.150: utils.vala:95: Execution of sync command [find "/data/eBooks" ! -readable -prune -o -type f \ ( -iname *.mobi -o -iname *.pdf -o -iname *.epub -o -iname *.cbr -o -iname *.cbz ) -print]: exited with non zero error code[256]. Error message:find: paths must precede expression: ` ('

Removing the whitespace infront of the first '(' makes it work again.

babluboy commented 4 years ago

Many thanks for your interest in Bookworm. It’s strange how the discover function was working so far with the space on Elementary OS....I will check if it works fine without the space and merge your PR....

Did you test this on eOS or on another distro?

babluboy commented 4 years ago

Ah I see what you mean. The commit you have sighted was a PR I merged - that looks like has created the space in the find command