Skip to content

Commit

Permalink
[JENKINS-40225] regroup os checks
Browse files Browse the repository at this point in the history
  • Loading branch information
blatinville committed Jan 5, 2017
1 parent 362f895 commit 998f0bb
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -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" )
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 998f0bb

Please sign in to comment.