I want to create grails script which adds an admin account to my application. Something like:
grails run-script utils/adminAdd.groovy username password
Unfortunately, it seems like run-script doesn't support passing arguments to scripts (allowing one to run multiple scripts at once, instead). Anyone knows a workaround?
This should be supported, so you should create an issue at http://jira.grails.org/browse/GRAILS
In the meantime I think to keep backwards compatibility you probably need a way to differentiate script names from args, e.g. a prefix:
grails run-script utils/adminAdd.groovy -Jusername -Jpassword -Jfoo=bar
Then run-script
could split out the args list into un-prefixed script names and send the de-prefixed args to each script as it runs.
Once you get it working locally send a pull request or attach the updated script to the JIRA and it'll get fixed a lot quicker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With