Skip to content

Commit 94b555e

Browse files
authoredSep 23, 2022
fix: set commitConvention default same as app (#318)
1 parent 382f44c commit 94b555e

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed
 

‎src/init/prompt.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const questions = [
3535
name: 'repoHost',
3636
message:
3737
"Where is the repository hosted? Hit Enter if it's on GitHub or GitLab",
38-
default: function(answers) {
38+
default: function (answers) {
3939
if (answers.repoType === 'github') {
4040
return 'https://github.com'
4141
} else if (answers.repoType === 'gitlab') {
@@ -58,10 +58,10 @@ const questions = [
5858
type: 'input',
5959
name: 'badgeFile',
6060
message: 'In which file should the badge be shown?',
61-
when: function(answers) {
61+
when: function (answers) {
6262
return answers.needBadge
6363
},
64-
default: function(answers) {
64+
default: function (answers) {
6565
return answers.contributorFile
6666
},
6767
},
@@ -84,14 +84,11 @@ const questions = [
8484
name: 'commitConvention',
8585
message: 'What commit convention would you want it to use?',
8686
choices: Object.values(conventions),
87-
default: 'none',
87+
default: 'angular',
8888
},
8989
]
9090

91-
const uniqueFiles = _.flow(
92-
_.compact,
93-
_.uniq,
94-
)
91+
const uniqueFiles = _.flow(_.compact, _.uniq)
9592

9693
module.exports = function prompt() {
9794
return git

‎src/util/config-file.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function readConfig(configPath) {
1010
config.repoType = 'github'
1111
}
1212
if (!('commitConvention' in config)) {
13-
config.commitConvention = 'none'
13+
config.commitConvention = 'angular'
1414
}
1515
if (changed) {
1616
//Updates the file with fixes
@@ -20,9 +20,7 @@ function readConfig(configPath) {
2020
} catch (error) {
2121
if (error instanceof SyntaxError) {
2222
throw new SyntaxError(
23-
`Configuration file has malformed JSON: ${configPath}. Error:: ${
24-
error.message
25-
}`,
23+
`Configuration file has malformed JSON: ${configPath}. Error:: ${error.message}`,
2624
)
2725
}
2826
if (error.code === 'ENOENT') {

0 commit comments

Comments
 (0)
Please sign in to comment.