From 45db917ee77af8a7b3416618ed7d281728f610e9 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Tue, 2 May 2017 15:27:07 +0900 Subject: [PATCH] Create plugins directory if it does not exist --- src/main/scala/gitbucket/core/plugin/PluginRegistory.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala b/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala index a963f5e16..7e5b0fdd0 100644 --- a/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala +++ b/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala @@ -3,7 +3,7 @@ package gitbucket.core.plugin import java.io.{File, FilenameFilter, InputStream} import java.net.URLClassLoader import java.nio.channels.{FileChannel, FileLock} -import java.nio.file.{Paths, StandardOpenOption, StandardWatchEventKinds} +import java.nio.file.{Files, Paths, StandardOpenOption, StandardWatchEventKinds} import java.util.Base64 import javax.servlet.ServletContext @@ -320,6 +320,9 @@ class PluginWatchThread(context: ServletContext) extends Thread with SystemSetti override def run(): Unit = { val path = Paths.get(PluginHome) + if(!Files.exists(path)){ + Files.createDirectories(path) + } val fs = path.getFileSystem val watcher = fs.newWatchService