How to debug scripts that are called by other tools?
If your script is called by another tool, you won't see any of the output. If something fails, or isn't working, the first thing is to add IO Redirection to all the calls to redirect the console output to a file.
It's simple:
- Make sure your script is actually called
- Make sure to collect all the output so you can see what's going on
1.
First we make sure that our script is actually called, by adding simple debugging statements like this:
Code: Select all
printenv > "/path/to/log.txt"
2.
Then we add IO redirection to the call that doesn't work:
Code: Select all
filebot -script fn:sysenv > "/path/to/log.txt" 2>&1
3.
Look at the example debug script:
https://github.com/filebot/plugins/blob ... h/debug.sh