From 94b555e274b2a8fec726c4da152fbb21383e1065 Mon Sep 17 00:00:00 2001 From: Angel Aviel Domaoan <13580338+tenshiAMD@users.noreply.github.com> Date: Sat, 24 Sep 2022 00:49:38 +0800 Subject: [PATCH] fix: set `commitConvention` default same as `app` (#318) --- src/init/prompt.js | 13 +++++-------- src/util/config-file.js | 6 ++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/init/prompt.js b/src/init/prompt.js index 87446a5..c6a402d 100644 --- a/src/init/prompt.js +++ b/src/init/prompt.js @@ -35,7 +35,7 @@ const questions = [ name: 'repoHost', message: "Where is the repository hosted? Hit Enter if it's on GitHub or GitLab", - default: function(answers) { + default: function (answers) { if (answers.repoType === 'github') { return 'https://github.com' } else if (answers.repoType === 'gitlab') { @@ -58,10 +58,10 @@ const questions = [ type: 'input', name: 'badgeFile', message: 'In which file should the badge be shown?', - when: function(answers) { + when: function (answers) { return answers.needBadge }, - default: function(answers) { + default: function (answers) { return answers.contributorFile }, }, @@ -84,14 +84,11 @@ const questions = [ name: 'commitConvention', message: 'What commit convention would you want it to use?', choices: Object.values(conventions), - default: 'none', + default: 'angular', }, ] -const uniqueFiles = _.flow( - _.compact, - _.uniq, -) +const uniqueFiles = _.flow(_.compact, _.uniq) module.exports = function prompt() { return git diff --git a/src/util/config-file.js b/src/util/config-file.js index 912d95f..fdcb154 100644 --- a/src/util/config-file.js +++ b/src/util/config-file.js @@ -10,7 +10,7 @@ function readConfig(configPath) { config.repoType = 'github' } if (!('commitConvention' in config)) { - config.commitConvention = 'none' + config.commitConvention = 'angular' } if (changed) { //Updates the file with fixes @@ -20,9 +20,7 @@ function readConfig(configPath) { } catch (error) { if (error instanceof SyntaxError) { throw new SyntaxError( - `Configuration file has malformed JSON: ${configPath}. Error:: ${ - error.message - }`, + `Configuration file has malformed JSON: ${configPath}. Error:: ${error.message}`, ) } if (error.code === 'ENOENT') {