From 9baf7b5514fc4855935320439ddfdea7ccae689c Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Wed, 21 May 2014 06:53:11 -0700 Subject: [PATCH] Fixes #55: not respecting cacheDir if not in grails profile --- .../springsource/loaded/GlobalConfiguration.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/springloaded/src/main/java/org/springsource/loaded/GlobalConfiguration.java b/springloaded/src/main/java/org/springsource/loaded/GlobalConfiguration.java index ce5ecca..13feab6 100644 --- a/springloaded/src/main/java/org/springsource/loaded/GlobalConfiguration.java +++ b/springloaded/src/main/java/org/springsource/loaded/GlobalConfiguration.java @@ -329,14 +329,16 @@ public class GlobalConfiguration { } } else { if (isCaching) { - try { - String userhome = System.getProperty("user.home"); - if (userhome != null) { - cacheDir = userhome; + if (cacheDir == null) { + try { + String userhome = System.getProperty("user.home"); + if (userhome != null) { + cacheDir = userhome; + } + } catch (Throwable t) { + System.err.println("looks like user.home is not set: cannot create cache."); + t.printStackTrace(System.err); } - } catch (Throwable t) { - System.err.println("looks like user.home is not set: cannot create cache."); - t.printStackTrace(System.err); } } }