diff --git a/core/src/main/java/hudson/tasks/Shell.java b/core/src/main/java/hudson/tasks/Shell.java index fc38bad2c4f6a65659b281f34b0d158683fd887e..e5f73ac10a971aa296528c11a6c3b20e6f105e6e 100644 --- a/core/src/main/java/hudson/tasks/Shell.java +++ b/core/src/main/java/hudson/tasks/Shell.java @@ -3,12 +3,15 @@ package hudson.tasks; import hudson.FilePath; import hudson.model.Descriptor; import static hudson.model.Hudson.isWindows; +import hudson.util.FormFieldValidator; +import net.sf.json.JSONObject; import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; +import javax.servlet.ServletException; +import java.io.IOException; import java.util.Map; -import net.sf.json.JSONObject; - /** * Executes a series of commands by using a shell. * @@ -70,7 +73,6 @@ public class Shell extends CommandInterpreter { load(); } - protected void convert(Map oldPropertyBag) { shell = (String)oldPropertyBag.get("shell"); } @@ -102,5 +104,12 @@ public class Shell extends CommandInterpreter { setShell(req.getParameter("shell")); return true; } + + /** + * Check the existence of sh in the given location. + */ + public void doCheck(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { + new FormFieldValidator.Executable(req,rsp).process(); + } } } diff --git a/core/src/main/resources/hudson/tasks/Shell/global.jelly b/core/src/main/resources/hudson/tasks/Shell/global.jelly index 1a4b741cd4bd090ddc9d00fcabe6dfa00a8880d6..5eba931df10c7765eaa0eb92aee9ccf907da5840 100644 --- a/core/src/main/resources/hudson/tasks/Shell/global.jelly +++ b/core/src/main/resources/hudson/tasks/Shell/global.jelly @@ -1,8 +1,7 @@ - + \ No newline at end of file