Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions lib/update-v8/minorUpdate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { spawn } from 'node:child_process';
import path from 'node:path';
import { promises as fs } from 'node:fs';

Expand Down Expand Up @@ -61,30 +60,22 @@ function doMinorUpdate() {
}

async function applyPatch(ctx, latestStr) {
const diff = spawn(
const diff = await forceRunAsync(
'git',
['format-patch', '--stdout', `${ctx.currentVersion}...${latestStr}`],
{ cwd: ctx.v8Dir, stdio: ['ignore', 'pipe', 'ignore'] }
{ captureStdout: true, ignoreFailure: false, spawnArgs: { cwd: ctx.v8Dir } }
);
try {
await forceRunAsync('git', ['apply', '--directory', 'deps/v8'], {
input: diff,
ignoreFailure: false,
spawnArgs: {
cwd: ctx.nodeDir,
stdio: [diff.stdout, 'ignore', 'ignore']
}
spawnArgs: { cwd: ctx.nodeDir }
});
} catch (e) {
const file = path.join(ctx.nodeDir, `${latestStr}.diff`);
await fs.writeFile(file, diff);
throw new Error(`Could not apply patch.\n${e}\nDiff was stored in ${file}`);
}
if (diff.exitCode !== 0) {
const err = new Error(`git format-patch failed: ${diff.exitCode}`);
err.code = diff.exitCode;
err.messageOnly = true;
throw err;
}
}

function filterAndSortTags(tags) {
Expand Down
Loading