Skip to content

Commit

Permalink
quote schema defaults that contain *
Browse files Browse the repository at this point in the history
  • Loading branch information
jetersen committed Jul 31, 2022
1 parent bd579b5 commit c3d9042
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions bin/generate-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ if (requiredField.length > 0) {
delete jsonSchema.required
}

for (const [key, value] of Object.entries(jsonSchema.properties)) {
if (typeof value.default === 'string' && value.default.includes('*')) {
jsonSchema.properties[key].default = `'${value.default}'`
}
}

if (inputArguments[0] === 'print') {
fs.writeFileSync(
'./schema.json',
Expand Down
4 changes: 2 additions & 2 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
},
"change-template": {
"default": "* $TITLE (#$NUMBER) @$AUTHOR",
"default": "'* $TITLE (#$NUMBER) @$AUTHOR'",
"type": "string"
},
"change-title-escapes": {
Expand All @@ -28,7 +28,7 @@
]
},
"no-changes-template": {
"default": "* No changes",
"default": "'* No changes'",
"type": "string"
},
"version-template": {
Expand Down

0 comments on commit c3d9042

Please sign in to comment.