diff --git a/core/src/main/java/hudson/tasks/Shell.java b/core/src/main/java/hudson/tasks/Shell.java index fc38bad2c4..e5f73ac10a 100644 --- a/core/src/main/java/hudson/tasks/Shell.java +++ b/core/src/main/java/hudson/tasks/Shell.java @@ -3,11 +3,14 @@ package hudson.tasks; import hudson.FilePath; import hudson.model.Descriptor; import static hudson.model.Hudson.isWindows; -import org.kohsuke.stapler.StaplerRequest; - -import java.util.Map; - +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; /** * 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 1a4b741cd4..5eba931df1 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