mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-15 17:42:48 +03:00
27 lines
704 B
TypeScript
27 lines
704 B
TypeScript
import { readdir } from 'node:fs/promises';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const outputRoot = fileURLToPath(
|
|
new URL(
|
|
'../out/canary/AFFiNE-canary-darwin-arm64/AFFiNE-canary.app/Contents/Resources/app',
|
|
import.meta.url
|
|
)
|
|
);
|
|
|
|
const outputList = [
|
|
['dist', ['main.js', 'helper.js', 'preload.js', 'affine.darwin-arm64.node']],
|
|
] as [entry: string, expected: string[]][];
|
|
|
|
await Promise.all(
|
|
outputList.map(async ([entry, output]) => {
|
|
const files = await readdir(`${outputRoot}/${entry}`);
|
|
output.forEach(file => {
|
|
if (!files.includes(file)) {
|
|
throw new Error(`File ${entry}/${file} not found`);
|
|
}
|
|
});
|
|
})
|
|
);
|
|
|
|
console.log('Output check passed');
|