Files
DndGamePlayer/scripts/release-mac-prep.mjs
T
Ivan Fontosh 2979d06f1c feat: multi-material overlays, presentation guides, and release prebuilds
Align control/presentation with presentation screen rect and darkness z-order; sync window titles and session window cleanup. Pack Win/Mac/Linux with npmRebuild disabled and release-native-prep for classic-level and sharp.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 11:28:18 +08:00

36 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Перед `electron-builder --mac`: npm ставит sharp только под CPU хоста.
* В release идут x64 и arm64 — в .app должны быть оба набора @img/sharp-darwin-*.
*/
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import {
ensureReleaseNativeDeps,
MAC_SHARP_IMG_PACKAGES,
sharpImgPackagesToInstall,
} from './release-native-prep.mjs';
/** @deprecated use sharpImgPackagesToInstall(root, MAC_SHARP_IMG_PACKAGES) */
export function macSharpImgPackagesToInstall(root) {
return sharpImgPackagesToInstall(root, MAC_SHARP_IMG_PACKAGES);
}
/**
* @param {string} root
* @param {{ runInstall?: boolean }} [opts]
*/
export function ensureMacSharpBinaries(root, opts = {}) {
ensureReleaseNativeDeps(root, 'mac', opts);
}
const isMain = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
if (isMain) {
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
if (process.platform !== 'darwin') {
console.warn('[release-mac-prep] skipped: not macOS (no dual-arch sharp prep needed here)');
process.exit(0);
}
ensureMacSharpBinaries(root);
}