Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficulties running scripts in headless mode #103

Open
baodrate opened this issue Apr 21, 2023 · 0 comments
Open

Difficulties running scripts in headless mode #103

baodrate opened this issue Apr 21, 2023 · 0 comments

Comments

@baodrate
Copy link

baodrate commented Apr 21, 2023

Running v9.3.0 on Arch Linux with that tar.gz package (but AFAICT these should affect the other Linux packages as well).

  1. the /opt/dbschema/DbSchema script changes the working directory (e.g. cd "$prg_dir"). This means both the -x GROOVY_SCRIPT argument as well as any paths in the actual script itself need to be absolute paths to resolve correctly.
  • I notice old_pwd is set in /opt/dbschema/DbSchema, but it is never restored
  1. Is there a way to pass arguments to the script? I've tried DbSchema -x SCRIPT arg1 arg2 as well as DbSchema -x SCRIPT -args foo bar but as far as I can tell those arguments are not being passed to the actual groovy script. Is this correct?

  2. 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.
  1. The script always exits with 0, even if it exited because of an uncaught exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant