dbschema
dbschema copied to clipboard
Difficulties running scripts in headless mode
trafficstars
Running v9.3.0 on Arch Linux with that tar.gz package (but AFAICT these should affect the other Linux packages as well).
- the
/opt/dbschema/DbSchemascript changes the working directory (e.g.cd "$prg_dir"). This means both the-x GROOVY_SCRIPTargument as well as any paths in the actual script itself need to be absolute paths to resolve correctly.
- I notice
old_pwdis set in/opt/dbschema/DbSchema, but it is never restored
-
Is there a way to pass arguments to the script? I've tried
DbSchema -x SCRIPT arg1 arg2as well asDbSchema -x SCRIPT -args foo barbut as far as I can tell those arguments are not being passed to the actual groovy script. Is this correct? -
Execution starts off by printing this to stdout:
DbSchema 9.3.0 build 230415
Execute Script '<SCRIPT_PATH>' as Java Groovy.
- this makes it harder to write simple scripts that just write to stdout because that preamble needs to be parsed away first. Could these lines be written to stderr instead? Or a command line flag/environment variable that disables it would work too.
- The script always exits with
0, even if it exited because of an uncaught exception