Skip to content

Commit b330fb3

Browse files
author
radeva
committed
fix: show error if occurs on plugin build
current behavior: when you run `npm i`, `prepare` is also run which results in running `tns plugin build`. Currently if the command fails, the user is not notified. updated behavior: if an error occurs during `npm plugin build`, error is shown.
1 parent b40e830 commit b330fb3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/scripts/prepare.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ exec('tns --version', (err, stdout, stderr) => {
1313
// execute 'tns plugin build' for {N} version > 4. This command builds .aar in platforms/android folder.
1414
if (tnsVersion >= 4) {
1515
console.log(`executing 'tns plugin build'`);
16-
exec('tns plugin build');
16+
exec('tns plugin build', (err, stdout, stderr) => {
17+
if (err) {
18+
// node couldn't execute the command
19+
console.log(`${err}`);
20+
return;
21+
}
22+
});
1723
}
18-
});
24+
});

0 commit comments

Comments
 (0)