mirror of
https://github.com/nimbold/Firelink.git
synced 2026-09-09 17:25:42 +00:00
725f5e40ec
- remove shared staging locks and the repository engine tree - stage verified target payloads in private atomic workspaces - fence Tauri bundles and process-tree cleanup across platforms - align CI, AppImage packaging, smoke checks, and release docs
31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
JavaScript
#!/usr/bin/env node
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import { resolveOutputRoot, resolveTargetTriple } from './engine-workspace.js';
|
|
|
|
if (
|
|
process.env.FIRELINK_SKIP_ENGINE_RESOURCE === '1'
|
|
|| process.env.FIRELINK_ENGINE_BUNDLE_PREPARED === '1'
|
|
) {
|
|
process.exit(0);
|
|
}
|
|
|
|
// Staging belongs to beforeBuildCommand or the standalone-bundle wrapper.
|
|
// This hook is a read-only fence against a missing payload immediately before
|
|
// Tauri consumes the resource tree.
|
|
const target = resolveTargetTriple();
|
|
const outputRoot = resolveOutputRoot();
|
|
const suffix = target.includes('windows') ? '.exe' : '';
|
|
const destination = path.join(outputRoot, target);
|
|
const expectedNames = ['yt-dlp', 'aria2c', 'ffmpeg', 'deno']
|
|
.map(engine => `${engine}-${target}${suffix}`);
|
|
|
|
for (const name of expectedNames) {
|
|
const candidate = path.join(destination, name);
|
|
if (!fs.existsSync(candidate) || !fs.lstatSync(candidate).isFile()) {
|
|
throw new Error(`Prepared engine payload is incomplete: ${candidate}`);
|
|
}
|
|
}
|
|
|
|
console.log(`Prepared engine payload is present for ${target} at ${destination}`);
|