fix(release): use relative postinstall patch dir (#5973)
Some checks are pending
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run

This commit is contained in:
易良 2026-06-29 11:11:21 +08:00 committed by GitHub
parent 68a9de4752
commit 98dec4fa71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View file

@ -394,10 +394,11 @@ if (chromeDevtoolsMcpPackageJson) {
if (!installRoot || !existsSync(patchDir)) {
process.exit(0);
}
const relativePatchDir = path.relative(installRoot, patchDir) || '.';
const patchPackageBin = require.resolve('patch-package/index.js');
const result = spawnSync(
process.execPath,
[patchPackageBin, '--patch-dir', patchDir, '--error-on-fail'],
[patchPackageBin, '--patch-dir', relativePatchDir, '--error-on-fail'],
{ cwd: installRoot, stdio: 'inherit' },
);
if (result.signal) {

View file

@ -229,11 +229,7 @@ describe('package asset scripts', () => {
const realDistDir = realpathSync(distDir);
expect(JSON.parse(readFileSync(markerPath, 'utf8'))).toEqual({
argv: [
'--patch-dir',
path.join(realDistDir, 'patches'),
'--error-on-fail',
],
argv: ['--patch-dir', 'patches', '--error-on-fail'],
cwd: realDistDir,
});
});