feat(@embark/cli): exit with error if --template and --contracts-only are both used with 'new' cmd

This commit is contained in:
Michael Bradley, Jr 2019-05-26 20:36:39 -05:00 committed by Pascal Precht
parent e5fc12e256
commit d477adc87e
1 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,11 @@ class Cmd {
.action(function(name, options) {
setOrDetectLocale(options.locale);
if (options.contractsOnly && options.template) {
console.error('invalid: --contracts-only and --template options cannot be used together'.red);
process.exit(1);
}
const contractsOnly = options.simple || options.contractsOnly;
if (name === undefined) {
@ -80,6 +85,7 @@ class Cmd {
}
});
}
if (contractsOnly) {
embark.generateTemplate('simple', './', name);
} else {