private Object readResolve() throws ObjectStreamException { Shell shell = new Shell(command); shell.setUnstableReturn(unstableReturn); return shell; }
public String[] buildCommandLine(FilePath script) { if(command.startsWith("#!")) { // interpreter override int end = command.indexOf('\n'); if(end<0) end=command.length(); List<String> args = new ArrayList<String>(); args.addAll(Arrays.asList(Util.tokenize(command.substring(0,end).trim()))); args.add(script.getRemote()); args.set(0,args.get(0).substring(2)); // trim off "#!" return args.toArray(new String[args.size()]); } else return new String[] { getDescriptor().getShellOrDefault(script.getChannel()), "-xe", script.getRemote()}; }
@Override public Builder newInstance(StaplerRequest req, JSONObject data) { return new Shell(data.getString("command")); }
protected String getContents() { return addCrForNonASCII(fixCrLf(command)); }
@DataBoundConstructor public Shell(String command, boolean disabled, String description) { super(fixCrLf(command)); this.setDisabled(disabled); setDescription(description); }
@DataBoundConstructor public Shell(String command) { super(fixCrLf(command)); }
@Override public Builder newInstance(StaplerRequest req, JSONObject data) { return new Shell(data.getString("command")); }
protected String getContents() { return addCrForNonASCII(fixCrLf(command)); }
@DataBoundConstructor public Shell(String command) { super(fixCrLf(command)); }
@Override public Builder newInstance(StaplerRequest req, JSONObject data) { return new Shell(data.getString("command")); }
private Object readResolve() throws ObjectStreamException { Shell shell = new Shell(command); shell.setUnstableReturn(unstableReturn); return shell; }
protected String getContents() { return addCrForNonASCII(fixCrLf(command)); }
public String[] buildCommandLine(FilePath script) { if(command.startsWith("#!")) { // interpreter override int end = command.indexOf('\n'); if(end<0) end=command.length(); List<String> args = new ArrayList<String>(); args.addAll(Arrays.asList(Util.tokenize(command.substring(0,end).trim()))); args.add(script.getRemote()); args.set(0,args.get(0).substring(2)); // trim off "#!" return args.toArray(new String[args.size()]); } else return new String[] { getDescriptor().getShellOrDefault(),"-xe",script.getRemote()}; }
@DataBoundConstructor public Shell(String command) { super(fixCrLf(command)); }
@Override public Builder newInstance(StaplerRequest req, JSONObject data) { return new Shell(data.getString("command"), data.getBoolean("disabled"), data.getString("description")); }
protected String getContents() { return addCrForNonASCII(fixCrLf(command)); }
public String[] buildCommandLine(FilePath script) { if(command.startsWith("#!")) { // interpreter override int end = command.indexOf('\n'); if(end<0) end=command.length(); List<String> args = new ArrayList<String>(); args.addAll(Arrays.asList(Util.tokenize(command.substring(0,end).trim()))); args.add(script.getRemote()); args.set(0,args.get(0).substring(2)); // trim off "#!" return args.toArray(new String[args.size()]); } else return new String[] { getDescriptor().getShellOrDefault(),"-xe",script.getRemote()}; }
private CommandInterpreter createInterpreter(String scriptContent) { if (launcher.isUnix()) { return new Shell(scriptContent); } return new BatchFile(scriptContent); }
public String[] buildCommandLine(FilePath script) { if(command.startsWith("#!")) { // interpreter override int end = command.indexOf('\n'); if(end<0) end=command.length(); List<String> args = new ArrayList<String>(); args.addAll(Arrays.asList(Util.tokenize(command.substring(0,end).trim()))); args.add(script.getRemote()); args.set(0,args.get(0).substring(2)); // trim off "#!" return args.toArray(new String[args.size()]); } else return new String[] { getDescriptor().getShellOrDefault(),"-xe",script.getRemote()}; }