Use java system properties to find the user's home directory before looking to ENV properties.

This commit is contained in:
Jonathan Bernard
2016-04-21 00:26:39 -05:00
parent 7bd9c64c44
commit 816820c427
2 changed files with 21 additions and 4 deletions

View File

@ -151,8 +151,13 @@ Configuration:
if (!cfgFile || !cfgFile.exists() || !cfgFile.isFile())
cfgFile = new File("wdiwtlt.cli.properties")
if (!cfgFile || !cfgFile.exists() || !cfgFile.isFile())
cfgFile = new File(System.getenv().HOME, ".wdiwtlt.cli.properties")
if (!cfgFile || !cfgFile.exists() || !cfgFile.isFile()) {
String userHome = System.getenv().HOME
if (userHome) cfgFile = new File(userHome, ".wdiwtlt.cli.properties")
if (!cfgFile || !cfgFile.exists() || !cfgFile.isFile()) {
userHome = System.getProperty('user.home')
if (userHome) cfgFile = new File(userHome, 'wdiwtlt.cli.properties') } }
if (cfgFile.exists() && cfgFile.isFile()) {
try { cfgFile.withInputStream { givenCfg.load(it) } }
@ -273,6 +278,9 @@ Configuration:
// Try to discover the VLC native libraries
def vlcj
try {
String vlcLibDir = opts['--vlc-lib-dir'] || givenCfg['vlc.lib.dir']
//if (vlcLibDir) NativeLibrary.addSearchPath('libvlc', vlcLibDir)
new NativeDiscovery().discover()
vlcj = new AudioMediaListPlayerComponent() }
catch (Exception e) {