init: ensure that tmp dir exists before extracting plugins

There was wrong assumpion in '--list-plugins' implementation tmp dir
was created before we start extracting plugins to obtain metadata
about them.

Ensure the tmp dir will be created if it is not existing yet.

Change-Id: Iac29499940b3cb8255456b0dcf21e5e6e9870ecd
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This commit is contained in:
Dariusz Luksza
2013-07-29 16:07:11 +02:00
committed by Shawn Pearce
parent a7bad77a08
commit 71de7c60e9

View File

@@ -166,6 +166,9 @@ public class PluginLoader implements LifecycleListener {
public static File storeInTemp(String pluginName, InputStream in,
SitePaths sitePaths) throws IOException {
if (!sitePaths.tmp_dir.exists()) {
sitePaths.tmp_dir.mkdirs();
}
return asTemp(in, tempNameFor(pluginName), ".jar", sitePaths.tmp_dir);
}