mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-04 18:03:43 +00:00
chore(@embark/cli): introduce alias for --simple
option in run
command
Closes #1025
This commit is contained in:
parent
96f7688ee8
commit
8a00e04c06
@ -50,11 +50,15 @@ class Cmd {
|
|||||||
program
|
program
|
||||||
.command('new [name]')
|
.command('new [name]')
|
||||||
.description(__('New Application'))
|
.description(__('New Application'))
|
||||||
.option('--simple', __('create a barebones project meant only for contract development'))
|
.option('--simple', __('an alias for --contracts-only'))
|
||||||
|
.option('--contracts-only', __('create a barebones project meant only for contract development'))
|
||||||
.option('--locale [locale]', __('language to use (default: en)'))
|
.option('--locale [locale]', __('language to use (default: en)'))
|
||||||
.option('--template <name/url>', __('download a template using a known name or a git host URL'))
|
.option('--template <name/url>', __('download a template using a known name or a git host URL'))
|
||||||
.action(function(name, options) {
|
.action(function(name, options) {
|
||||||
i18n.setOrDetectLocale(options.locale);
|
i18n.setOrDetectLocale(options.locale);
|
||||||
|
|
||||||
|
const contractsOnly = options.simple || options.contractsOnly;
|
||||||
|
|
||||||
if (name === undefined) {
|
if (name === undefined) {
|
||||||
const promptly = require('promptly');
|
const promptly = require('promptly');
|
||||||
return promptly.prompt(__("Name your app (default is %s):", 'embarkDapp'), {
|
return promptly.prompt(__("Name your app (default is %s):", 'embarkDapp'), {
|
||||||
@ -68,7 +72,7 @@ class Cmd {
|
|||||||
err.retry();
|
err.retry();
|
||||||
} else {
|
} else {
|
||||||
//slightly different assignment of name since it comes from child prompt
|
//slightly different assignment of name since it comes from child prompt
|
||||||
if (options.simple) {
|
if (contractsOnly) {
|
||||||
embark.generateTemplate('simple', './', inputvalue);
|
embark.generateTemplate('simple', './', inputvalue);
|
||||||
} else {
|
} else {
|
||||||
embark.generateTemplate('boilerplate', './', inputvalue, options.template);
|
embark.generateTemplate('boilerplate', './', inputvalue, options.template);
|
||||||
@ -76,7 +80,7 @@ class Cmd {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (options.simple) {
|
if (contractsOnly) {
|
||||||
embark.generateTemplate('simple', './', name);
|
embark.generateTemplate('simple', './', name);
|
||||||
} else {
|
} else {
|
||||||
embark.generateTemplate('boilerplate', './', name, options.template);
|
embark.generateTemplate('boilerplate', './', name, options.template);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user