diff --git a/src/java/com/threerings/presents/tools/InvocationTask.java b/src/java/com/threerings/presents/tools/InvocationTask.java index 905e7a8db..878930d2e 100644 --- a/src/java/com/threerings/presents/tools/InvocationTask.java +++ b/src/java/com/threerings/presents/tools/InvocationTask.java @@ -411,7 +411,11 @@ public abstract class InvocationTask extends GenTask if (_header != null) { data = _header + data; } - new PrintWriter(new File(path), "UTF-8").append(data).close(); + File dest = new File(path); + if (!dest.getParentFile().exists() && !dest.getParentFile().mkdirs()) { + throw new BuildException("Unable to create directory for " + dest.getAbsolutePath()); + } + new PrintWriter(dest, "UTF-8").append(data).close(); } protected static void checkedAdd (List list, T value)