Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在命令行覆盖groovysh.profile/groovysh.rc文件的位置?例如
groovysh.profile
groovysh.rc
GROOVYSH_RC=one_time_groovysh_rc groovysh
谢谢。
在查看 Groovysh.groovy 的源代码时,它调用了这个方法:
File getUserStateDirectory() { def userHome = new File(System.getProperty('user.home')) def dir = new File(userHome, '.groovy') return dir.canonicalFile }
看起来您可以设置“user.home”属性来更改根目录,但它仍然需要该目录中的 .groovy (-Duser.home="/foo")。