Skip to content

Commit 0ead0a1

Browse files
authored
fix(git-node): prefill both patch and minor versions when requesting CVEs (#1095)
1 parent 4ad397f commit 0ead0a1

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

lib/cli.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ export default class CLI {
9494
return answer;
9595
}
9696

97+
async promptRadio(message, choices, opts = undefined) {
98+
if (Object.hasOwn(opts, 'defaultAnswer')) {
99+
opts.default = opts.defaultAnswer;
100+
}
101+
return inquirer.select({
102+
...opts,
103+
message, choices,
104+
});
105+
}
106+
97107
async promptCheckbox(message, choices) {
98108
if (this.assumeYes) {
99109
return choices.filter((c) => c.checked).map((c) => c.value);

lib/update_security_release.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ Summary: ${summary}\n`,
321321

322322
const nextPatchVersion = semver.inc(version, 'patch');
323323
const nextMinorVersion = semver.inc(version, 'minor');
324-
const patchedVersion = await this.cli.prompt(
324+
const patchedVersion = await this.cli.promptRadio(
325325
`What is the patched version (>=) for release line ${affectedVersion}?`,
326+
[nextPatchVersion, nextMinorVersion],
326327
{
327-
questionType: 'input',
328328
defaultAnswer: isPatchRelease ? nextPatchVersion : nextMinorVersion
329329
});
330330

0 commit comments

Comments
 (0)