mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-16 06:06:18 -08:00
build(embedded-mpv): streamline macOS native output handling and packaging process
Entire-Checkpoint: c6e522b4276c
This commit is contained in:
1 parent
6aa4f2521b
commit
b25fc040b5
5 files changed
+34
-42
No files matched your search
@@ -17,6 +17,30 @@ function isTruthy(value) {
|
||||
);
|
||||
}
|
||||
|
||||
function copyEmbeddedMpvNativeOutput(resourceDir, projectDir) {
|
||||
const sourceDir = path.join(
|
||||
projectDir,
|
||||
'dist',
|
||||
'apps',
|
||||
'electron-backend',
|
||||
'native'
|
||||
);
|
||||
|
||||
if (!fs.existsSync(sourceDir)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const destinationDir = path.join(
|
||||
resourceDir,
|
||||
'app.asar.unpacked',
|
||||
'electron-backend',
|
||||
'native'
|
||||
);
|
||||
|
||||
fs.rmSync(destinationDir, { recursive: true, force: true });
|
||||
fs.cpSync(sourceDir, destinationDir, { recursive: true });
|
||||
}
|
||||
|
||||
async function afterPackHook(params) {
|
||||
await linuxAfterPack(params);
|
||||
|
||||
@@ -46,6 +70,12 @@ async function afterPackHook(params) {
|
||||
'Resources'
|
||||
)
|
||||
: params.appOutDir;
|
||||
|
||||
copyEmbeddedMpvNativeOutput(
|
||||
resourceDir,
|
||||
params.packager.projectDir ?? process.cwd()
|
||||
);
|
||||
|
||||
const errors = validatePackagedEmbeddedMpv(resourceDir, {
|
||||
required: requireEmbeddedMpv,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user