Skip to content

Commit 71f2ca6

Browse files
Fatme HavaluovaDimitar Kerezov
authored andcommitted
Fail if sandbox install command fails
1 parent 96a484a commit 71f2ca6

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

lib/services/ios-project-service.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,24 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
514514

515515
this.$logger.info("Installing pods...");
516516
let podTool = this.$config.USE_POD_SANDBOX ? "sandbox-pod" : "pod";
517-
return this.$childProcess.spawnFromEvent(podTool, ["install"], "close", { cwd: this.platformData.projectRoot, stdio: 'inherit' }).wait();
517+
let childProcess = this.$childProcess.spawnFromEvent(podTool, ["install"], "close", { cwd: this.platformData.projectRoot, stdio: ['pipe', process.stdout, 'pipe'] }).wait();
518+
if (childProcess.stderr) {
519+
let warnings = childProcess.stderr.match(/(\u001b\[(?:\d*;){0,5}\d*m[\s\S]+?\u001b\[(?:\d*;){0,5}\d*m)|(\[!\].*?\n)/g);
520+
let result = _.reduce(warnings, (result: string, warning: string) => {
521+
return result + `[Warning]${warning.replace("\n", "")}${os.EOL}`.yellow;
522+
}, "");
523+
this.$logger.info(result);
524+
525+
let errors = childProcess.stderr;
526+
_.each(warnings, warning => {
527+
errors = errors.replace(warning, "");
528+
});
529+
if(errors) {
530+
this.$errors.failWithoutHelp(`Pod install command failed. Error output: ${errors}`);
531+
}
532+
}
533+
534+
return childProcess;
518535
}).future<any>()();
519536
}
520537

lib/services/platform-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export class PlatformService implements IPlatformService {
209209
} catch(error) {
210210
this.$logger.debug(error);
211211
shell.rm("-rf", appResourcesDirectoryPath);
212-
this.$errors.fail(`Processing node_modules failed. Error:${error}`);
212+
this.$errors.failWithoutHelp(`Processing node_modules failed. ${error}`);
213213
}
214214

215215
// Process platform specific files

0 commit comments

Comments
 (0)