From 39090fa83270b5cfc303aa5f2c924c5ad8649e53 Mon Sep 17 00:00:00 2001 From: Troy Mullaney Date: Thu, 15 Nov 2018 11:37:12 -0700 Subject: [PATCH 1/2] Avoid asking user to use template if `templateName` exists --- src/.DS_Store | Bin 6148 -> 0 bytes src/index.js | 13 +------------ 2 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 src/.DS_Store diff --git a/src/.DS_Store b/src/.DS_Store deleted file mode 100644 index 4e70b01da3a9ec6528fe43bb7bf068b83e3bf9c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKJ5B>p3>-s>NHh@@<+}nmSVe&YkP9G@6%9#HP!Q!-IaiLx_#;HLK~ywoEZOs( z*YlosiuD?R&G)NYUn<&b<=4(Fh3Wvm?Gaq!Keg<3@nH2bI1wH{rWEi;s diff --git a/src/index.js b/src/index.js index 5c0c528..63f02c1 100644 --- a/src/index.js +++ b/src/index.js @@ -32,22 +32,11 @@ async function getTemplatesPath(templateName = null) { } async function getTemplateOption() { - const templateArg = args.t || args.template + const templateArg = config.t || config.template || config.templateName if (templateArg) { return getTemplatesPath(templateArg) } - const { template } = await inquirer.prompt([ - { - type: 'confirm', - name: 'template', - message: 'Do you wanna choose a template', - default: false, - }, - ]) - if (template) { - return getTemplatesPath() - } return null } From cb68e11c1932c248d8fbc5ed7a103324afe1339d Mon Sep 17 00:00:00 2001 From: Troy Mullaney Date: Tue, 20 Nov 2018 16:02:47 -0700 Subject: [PATCH 2/2] Add back asking to use a template when none is specified --- src/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/index.js b/src/index.js index 63f02c1..59c4e0f 100644 --- a/src/index.js +++ b/src/index.js @@ -37,6 +37,18 @@ async function getTemplateOption() { return getTemplatesPath(templateArg) } + const { template } = await inquirer.prompt([ + { + type: 'confirm', + name: 'template', + message: 'Do you wanna choose a template', + default: false, + }, + ]) + if (template) { + return getTemplatesPath() + } + return null }