tags:

views:

73

answers:

1

Is there a way to override the location of the groovysh.profile / groovysh.rc file on the command line? e.g.

GROOVYSH_RC=one_time_groovysh_rc groovysh

Thanks.

+1  A: 

In looking at the source to Groovysh.groovy, it calls this method:

File getUserStateDirectory() {
    def userHome = new File(System.getProperty('user.home'))
    def dir = new File(userHome, '.groovy')
    return dir.canonicalFile
}

Looks like you could set the "user.home" property to change the root, but it still expects a .groovy inside that directory (-Duser.home="/foo").

Ted Naleid