Skip to content
Permalink
Browse files
[JENKINS-32286] fix
  • Loading branch information
boaglio committed Jan 9, 2016
1 parent e91ed8f commit 69b94179dc725bf99444eef1c94303cf095b3e73
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/main/java/org/jenkinsci/plugins/sqlplusscriptrunner/SQLPlusRunner.java
@@ -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);
@@ -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()) {
@@ -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();

0 comments on commit 69b9417

Please sign in to comment.