8000 Letting postInstallScript fails gracefully · raydtang/esp8266-arduino-master@99fa19c · GitHub
[go: up one dir, main page]

Skip to content

Commit 99fa19c

Browse files
author
Federico Fissore
committed
Letting postInstallScript fails gracefully
1 parent f1fc079 commit 99fa19c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arduino-core/src/cc/arduino/contributions/packages/ContributionInstaller.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,16 @@ public boolean apply(File file) {
192192
ByteArrayOutputStream stderr = new ByteArrayOutputStream();
193193
Executor executor = new CollectStdOutStdErrExecutor(stdout, stderr);
194194
executor.setWorkingDirectory(folder);
195-
executor.execute(new CommandLine(postInstallScript));
195+
executor.setExitValues(null);
196+
int exitValue = executor.execute(new CommandLine(postInstallScript));
197+
executor.setExitValues(new int[0]);
196198

197199
System.out.write(stdout.toByteArray());
198200
System.err.write(stderr.toByteArray());
201+
202+
if (executor.isFailure(exitValue)) {
203+
throw new IOException();
204+
}
199205
}
200206

201207
public List<String> remove(ContributedPlatform platform) {

0 commit comments

Comments
 (0)
0