提交 2ea3d8f1 编写于 作者: K Kohsuke Kawaguchi

if available, use the path variable exposed from winsw.

See https://github.com/kohsuke/winsw/commit/2ffdbde6a92cf582baa4137e7b4de1116a3ca88b
上级 54fc890f
......@@ -123,7 +123,10 @@ public class WindowsServiceLifecycle extends Lifecycle {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
StreamTaskListener task = new StreamTaskListener(baos);
task.getLogger().println("Restarting a service");
File executable = new File(home, "hudson.exe");
String exe = System.getenv("WINSW_EXECUTABLE");
File executable;
if (exe!=null) executable = new File(exe);
else executable = new File(home, "hudson.exe");
if (!executable.exists()) executable = new File(home, "jenkins.exe");
int r = new LocalLauncher(task).launch().cmds(executable, "restart")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册