Skip to content
Permalink
Browse files

[JENKINS-40225] regroup os checks

  • Loading branch information...
blatinville committed Jan 5, 2017
1 parent 362f895 commit 998f0bbd1792703aa0d6ae32bcfb10eb62794097
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/main/java/org/jenkinsci/plugins/durabletask/BourneShellScript.java
@@ -99,6 +99,11 @@ public String getScript() {
shf.chmod(0755);

scriptPath = shf.getRemote();
List<String> args = new ArrayList<String>();

if (!ws.act(new DarwinCheck())) { // JENKINS-25848
args.add("nohup");
}
if (ws.act(new WindowsCheck())) { // JENKINS-40255
scriptPath= scriptPath.replace("\\", "/"); // cygwin sh understands mixed path (ie : "c:/jenkins/workspace/script.sh" )
}
@@ -126,10 +131,6 @@ public String getScript() {
}
cmd = cmd.replace("$", "$$"); // escape against EnvVars jobEnv in LocalLauncher.launch

List<String> args = new ArrayList<String>();
if (!ws.act(new DarwinCheck())) { // JENKINS-25848
args.add("nohup");
}
args.addAll(Arrays.asList("sh", "-c", cmd));
Launcher.ProcStarter ps = launcher.launch().cmds(args).envs(envVars).pwd(ws).quiet(true);
listener.getLogger().println("[" + ws.getRemote().replaceFirst("^.+/", "") + "] Running shell script"); // -x will give details

0 comments on commit 998f0bb

Please sign in to comment.
You can’t perform that action at this time.