Skip to content

Commit

Permalink
Letting postInstallScript fails gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Fissore committed Apr 2, 2015
1 parent f1fc079 commit 99fa19c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,16 @@ public boolean apply(File file) {
ByteArrayOutputStream stderr = new ByteArrayOutputStream();
Executor executor = new CollectStdOutStdErrExecutor(stdout, stderr);
executor.setWorkingDirectory(folder);
executor.execute(new CommandLine(postInstallScript));
executor.setExitValues(null);
int exitValue = executor.execute(new CommandLine(postInstallScript));
executor.setExitValues(new int[0]);

System.out.write(stdout.toByteArray());
System.err.write(stderr.toByteArray());

if (executor.isFailure(exitValue)) {
throw new IOException();
}
}

public List<String> remove(ContributedPlatform platform) {
Expand Down

0 comments on commit 99fa19c

Please sign in to comment.