Closed ryanberckmans closed 9 years ago
Specified as a config param?
A config param would be fine, e.g. Config.groovy:
grails-console {
newFileContents = "import my.thing.*; def myService = ctx.getBean('myService'); ....."
}
A better solution might be something like resources/grails-console-new-file.groovy
, and in Config.groovy grails-console.newFileTemplate = 'resources/grails-console-new-file.groovy
.
I can see our new file template becoming very complex. Load classes, helpers, all sorts of boilerplate. We have many common operations used to debug + one-off maintenance tasks.
Thanks for your attention - this change would be a big help to us.
Having just experience this personally, it would be extremely valuable to execute a block of code to determine what text is displayed in the new file.
I want my production console to say "WARNING PRODUCTION" :+1:
I just accidentally ran a (blessedly read-only) command in production instead of development. So in my case, I'll case on BuildConfig.ENVIRONMENT
(or whatever it actually is) to set my file template, and the production template will have warnings.
Thanks! Love it. Any timeline on new 1.X release? (We're on grails 2).
I see https://grails.org/plugin/console --> Last Updated: 25 February 2015
v1.5.5 should be available now
We use grails-console 1.5.3.
Is it possible to have new console files use a specific template?
Whenever I create a new file, I always start with:
It would be extremely helpful to set a template which gave us more to work with for new files. Thanks