X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FInstance.java;h=33c65e003aeddc21a7f70e36b342b123a9e6f5ac;hp=cd57efe038532e78d6983e2e2cbd410184e16884;hb=2284842831ea46e89b97dd22b6e294caad361f30;hpb=b4dc6ab518ded2dd92e4cbb02ac615b1d57e8e6d diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index cd57efe..33c65e0 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -30,11 +30,15 @@ public class Instance { // Most of the rest is dependent upon this: config = new ConfigBundle(); - String configDir = System.getenv("CONFIG_DIR"); + String configDir = System.getProperty("CONFIG_DIR"); + if (configDir == null) { + configDir = System.getenv("CONFIG_DIR"); + } if (configDir == null) { configDir = new File(System.getProperty("user.home"), ".fanfix") .getPath(); } + if (configDir != null) { if (!new File(configDir).exists()) { new File(configDir).mkdirs(); @@ -87,20 +91,14 @@ public class Instance { debug = true; } - if (tmp == null || readerTmp == null) { - String tmpDir = System.getProperty("java.io.tmpdir"); - if (tmpDir != null) { - if (tmp == null) { - tmp = new File(tmpDir, "fanfic-tmp"); - } - if (readerTmp == null) { - readerTmp = new File(tmpDir, "fanfic-reader"); - } - } else { - syserr(new IOException( - "The system does not have a default temporary directory")); - } + // Could have used: System.getProperty("java.io.tmpdir") + if (tmp == null) { + tmp = new File(configDir, "tmp"); + } + if (readerTmp == null) { + readerTmp = new File(configDir, "tmp-reader"); } + // if (coverDir != null && !coverDir.exists()) { syserr(new IOException(