fix: run packed bundled postinstall in release check

(cherry picked from commit e57e54e591)
This commit is contained in:
Peter Steinberger
2026-04-21 09:34:33 +01:00
parent 714598774f
commit d2185bd45b
4 changed files with 60 additions and 1 deletions

View File

@@ -807,6 +807,20 @@ export function runBundledPluginPostinstall(params = {}) {
});
}
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
export function isDirectPostinstallInvocation(params = {}) {
const entryPath = params.entryPath ?? process.argv[1];
if (!entryPath) {
return false;
}
const modulePath = params.modulePath ?? fileURLToPath(import.meta.url);
const resolveRealPath = params.realpathSync ?? realpathSync;
try {
return resolveRealPath(entryPath) === resolveRealPath(modulePath);
} catch {
return pathToFileURL(entryPath).href === pathToFileURL(modulePath).href;
}
}
if (isDirectPostinstallInvocation()) {
runBundledPluginPostinstall();
}