I need to run a couple of application on the same host as the same user with different set of custom commands registered in the groovysh.profile. Is it possible to tell groovysh to not load the $HOME/.groovy/groovysh.profile and instead load what is set in some commandline argument?
Asked
Active
Viewed 225 times
1
-
Why are you running applications in groovysh? – tim_yates Jan 17 '16 at 20:45
1 Answers
-1
Not unless if you're willing to change user.home
value. groovysh.groovy code says:
File getUserStateDirectory() {
def userHome = new File(System.getProperty('user.home'))
def dir = new File(userHome, '.groovy')
return dir.canonicalFile
}
So you could do -Duser.home=/foo
. Note that groovyshell still expects a .groovy
folder in /foo
. Also keep in mind that a lot of other programs and utilities use user.home
because that's where default settings usually live - changing it could potentially break something else.

RaGe
- 22,696
- 11
- 72
- 104