fix(desktop): ship the plugin SDK inside Mac App Store builds (#1551)

This commit is contained in:
ZacharyZcR authored and GitHub committed 2026-10-03 21:03:47 +08:00
1 parent 7b2198e18c
commit ab7a68aa84
2 files changed
+47 -10

No files matched your search

+15 -9
View File
@@ -30,6 +30,20 @@ function copyPluginSdk(resourcesDir, sdkDir = path.join(repoRoot, "packages", "p
exports.copyPluginSdk = copyPluginSdk;
/** Mac App Store builds report "mas", not "darwin", but are still .app bundles. */
function resourcesDirFor({ electronPlatformName, appOutDir, packager }) {
return ["darwin", "mas"].includes(electronPlatformName)
? path.join(
appOutDir,
`${packager.appInfo.productFilename}.app`,
"Contents",
"Resources",
)
: path.join(appOutDir, "resources");
}
exports.resourcesDirFor = resourcesDirFor;
exports.default = async function afterPack(context) {
const { targets, appOutDir } = context;
@@ -39,15 +53,7 @@ exports.default = async function afterPack(context) {
fs.writeFileSync(markerPath, "");
}
const resourcesDir =
context.electronPlatformName === "darwin"
? path.join(
appOutDir,
`${context.packager.appInfo.productFilename}.app`,
"Contents",
"Resources",
)
: path.join(appOutDir, "resources");
const resourcesDir = resourcesDirFor(context);
copyPluginSdk(resourcesDir);