Skip to content

Commit

Permalink
fix release script hanging on applying new changes (#4908)
Browse files Browse the repository at this point in the history
  • Loading branch information
rochdev authored Nov 19, 2024
1 parent add2338 commit 04ad392
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions scripts/release/helpers/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const RESET = '\x1b[0m'

const print = (...msgs) => msgs.forEach(msg => process.stdout.write(msg))
const log = (...msgs) => msgs.forEach(msg => print(`${msg}\n`))
const fatal = (...msgs) => log(...msgs) || process.exit(1)
const fatal = (...msgs) => fail() || log(...msgs) || process.exit(1)

let timer
let current
Expand Down Expand Up @@ -115,7 +115,9 @@ function fail (err) {

current = undefined

throw err
if (err) {
throw err
}
}

// Parse CLI arguments into parameters and flags.
Expand Down
12 changes: 6 additions & 6 deletions scripts/release/proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ try {
.replace(/\n/g, ' ').trim()

if (proposalDiff) {
pass(`${proposalDiff.split(' ').length} new`)
// Get new changes since last commit of the proposal branch.
const newChanges = capture(`${diffCmd} v${newVersion}-proposal master`)

pass(`\n${newChanges}`)

start('Apply changes from the main branch')

Expand All @@ -109,14 +112,11 @@ try {
run('git reset --hard HEAD~1')
}

// Output new changes since last commit of the proposal branch.
const newChanges = capture(`${diffCmd} v${newVersion}-proposal master`)

log(`\n${newChanges}\n`)

// Cherry pick all new commits to the proposal branch.
try {
run(`echo "${proposalDiff}" | xargs git cherry-pick`)

pass()
} catch (err) {
fatal(
'Cherry-pick failed. Resolve the conflicts and run `git cherry-pick --continue` to continue.',
Expand Down

0 comments on commit 04ad392

Please sign in to comment.