| 140 | } |
| 141 | |
| 142 | async function getPreviousCommitSha() { |
| 143 | const choices = []; |
| 144 | |
| 145 | const lines = await execRead(` |
| 146 | git log --max-count=5 --topo-order --pretty=format:'%H:::%s:::%as' HEAD -- ${join( |
| 147 | ROOT_PATH, |
| 148 | PACKAGE_PATHS[0] |
| 149 | )} |
| 150 | `); |
| 151 | |
| 152 | lines.split('\n').forEach((line, index) => { |
| 153 | const [hash, message, date] = line.split(':::'); |
| 154 | choices.push({ |
| 155 | name: `${chalk.bold(hash)} ${chalk.dim(date)} ${message}`, |
| 156 | value: hash, |
| 157 | short: date, |
| 158 | }); |
| 159 | }); |
| 160 | |
| 161 | const {sha} = await inquirer.prompt([ |
| 162 | { |
| 163 | type: 'list', |
| 164 | name: 'sha', |
| 165 | message: 'Which of the commits above marks the last DevTools release?', |
| 166 | choices, |
| 167 | default: choices[0].value, |
| 168 | }, |
| 169 | ]); |
| 170 | |
| 171 | return sha; |
| 172 | } |
| 173 | |
| 174 | async function getReleaseType() { |
| 175 | const {releaseType} = await inquirer.prompt([ |