Can you tell if command line filebot fails?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
douglasf
Posts: 2
Joined: 05 Jul 2013, 19:16

Can you tell if command line filebot fails?

Post by douglasf »

Like the subject says, can you tell if the command line version fails in any programatical way? If not it would be great if it returned 0 or 1, or anything like that. So that you could do something like this (obviously not a great example but I hope you get my point ;))

Code: Select all

res=`filebot -rename .`
if [ $res = 0 ]; then
    echo "there was an error"
else
    rm -rf .
fi
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Can you tell if command line filebot fails?

Post by rednoah »

It does return -1 on error, anything that aborts the whole program flow anyway. If the input set can only partially processed that's not a cause for aborting the whole thing.

For exact error handling I'll need to write a filebot/groovy script:
http://www.filebot.net/script.html#functions

You'll have the input fileset and rename(...) will give you a set of processed File objects that you can check for integrity or error logic you want.

PS: If you wanna do any kinda scripting related to filebot, best to do it with groovy right away.
:idea: Please read the FAQ and How to Request Help.
douglasf
Posts: 2
Joined: 05 Jul 2013, 19:16

Re: Can you tell if command line filebot fails?

Post by douglasf »

I see, but i assume that a "Fail" is not regarded as an error then because i just got the whole set of text lines in return then.

Anyway, I'll write it in groovy then, just didn't want to have unnecessary script files ;)

Thank you!
Post Reply