Skip to content

Commit

Permalink
fix: set commitConvention default same as app (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
tenshiAMD committed Sep 23, 2022
1 parent 382f44c commit 94b555e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
13 changes: 5 additions & 8 deletions src/init/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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
},
},
Expand All @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/util/config-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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') {
Expand Down

0 comments on commit 94b555e

Please sign in to comment.