Skip to content

Commit

Permalink
[JENKINS-32286] fix
Browse files Browse the repository at this point in the history
  • Loading branch information
boaglio committed Jan 9, 2016
1 parent e91ed8f commit 69b9417
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -162,7 +162,9 @@ public Void invoke(File path,VirtualChannel channel) throws IOException,Interrup
script = createTempScript(script);
listener.getLogger().println(MSG_TEMP_SCRIPT + script);
} else {
listener.getLogger().println(MSG_SCRIPT + script + ON + " " + user + SLASH + HIDDEN_PASSWORD + AT + instanceStr);
listener.getLogger().println(MSG_SCRIPT + " " + path + File.separator + script + " " + ON + " " + user + SLASH + HIDDEN_PASSWORD + AT + instanceStr);
File scriptFile = new File(path + File.separator + script);
if (!scriptFile.exists()) { throw new RuntimeException(Messages.SQLPlusRunner_missingScript(path + File.separator + script)); }
}

listener.getLogger().println(LINE);
Expand All @@ -181,7 +183,13 @@ public Void invoke(File path,VirtualChannel channel) throws IOException,Interrup
arg1 = arg1 + AT + instance;
}

String arg2 = script;
String arg2 = "";

if (ScriptType.userDefined.name().equals(scriptType)) {
arg2 = script;
} else {
arg2 = path + File.separator + script;
}

String sqlplus = SQLPLUS;
if (isWindowsOS()) {
Expand All @@ -196,6 +204,8 @@ public Void invoke(File path,VirtualChannel channel) throws IOException,Interrup
ProcessBuilder proc = new ProcessBuilder(args.toList());
proc.environment().putAll(envVars);
proc.redirectErrorStream(true);
proc.directory(path);

Process process = proc.start();
int exitCode = process.waitFor();

Expand Down

0 comments on commit 69b9417

Please sign in to comment.