Skip to content

Commit fd47bee

Browse files
committed
tweak bump omicron script to prompt for message
1 parent f6a3c06 commit fd47bee

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

tools/deno/bump-omicron.ts

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,29 +116,25 @@ const commitsMarkdown = commits.split('\n').map(linkifyGitLog).join('\n')
116116
const changesLine = `https://github.com/oxidecomputer/console/compare/${commitRange}`
117117

118118
const branchName = 'bump-console-' + newCommit.slice(0, 8)
119-
const prTitle = 'Bump web console' + (args.message ? ` (${args.message})` : '')
120119
const prBody = `${changesLine}\n\n${commitsMarkdown}`
121120

122-
// markdown links make the inline preview unreadable, so leave them out
123-
const prBodyPreview = `${changesLine}\n\n${commits}`
121+
console.log(`\n${changesLine}\n\n${commits}\n`)
124122

125-
console.log(`
126-
New contents of <omicron>/tools/console_version:
123+
if (args.dryRun) Deno.exit()
127124

128-
${newVersionFile}
125+
const message =
126+
args.message ||
127+
(await $.prompt({
128+
message: 'Description? (enter to skip)',
129+
noClear: true,
130+
}))
129131

130-
Branch: ${branchName}
131-
PR title: ${prTitle}
132+
const prTitle = 'Bump web console' + (message ? ` (${message})` : '')
132133

133-
--------
134-
PR body
135-
--------
136-
137-
${prBodyPreview}`)
134+
console.log(`\nPR title: ${prTitle}\n`)
138135

139-
if (args.dryRun || !confirm('\nMake Omicron PR with these changes?')) {
140-
Deno.exit()
141-
}
136+
const go = await $.confirm({ message: 'Make Omicron PR?', noClear: true })
137+
if (!go) Deno.exit()
142138

143139
if (!$.commandExistsSync('gh')) throw Error(GH_MISSING)
144140

0 commit comments

Comments
 (0)