CLI: Bypass build error to complete plugin creation (#3242)

* Bypass build error to complete plugin creation

* Stop building and linting plugin if error occures
This commit is contained in:
Philipp Hugenroth
2020-11-05 15:05:29 +01:00
committed by GitHub
parent e156211f3b
commit 728f772d15
@@ -140,15 +140,21 @@ async function buildPlugin(pluginFolder: string) {
'yarn build',
];
for (const command of commands) {
await Task.forItem('executing', command, async () => {
process.chdir(pluginFolder);
await exec(command).catch(error => {
try {
await Task.forItem('executing', command, async () => {
process.chdir(pluginFolder);
await exec(command);
}).catch(error => {
process.stdout.write(error.stderr);
process.stdout.write(error.stdout);
throw new Error(`Could not execute command ${chalk.cyan(command)}`);
throw new Error(
`Warning: Could not execute command ${chalk.cyan(command)}`,
);
});
});
} catch (error) {
Task.error(error.message);
break;
}
}
}