- Removed obsolete test script `test_crawl4ai_fit_markdown.py`. - Deleted `verify-package-main-obfuscation.mjs` as it is no longer needed. - Updated paths in `app-update-publish-config.test.ts` to reflect new script locations. - Refactored `package-content-policy.test.ts` to use new paths for content policy scripts. - Adjusted `package-main-obfuscation.test.ts` to point to the new obfuscation script locations. - Modified `package-size-budget.test.ts` to use updated paths for size budget scripts. - Changed `r2-update-metadata-contract.test.ts` to reference the new metadata script. - Updated `release-fragment-contract.test.ts` to use the new fragment contract script. - Refactored `release-storage-layout.test.ts` to point to the new storage layout script. - Added `runtime-trace.test.ts` to test runtime tracing functionality. - Updated `node-pty-native-release.test.ts` to reflect new paths for native release scripts.
32 lines
890 B
JavaScript
32 lines
890 B
JavaScript
import { existsSync } from 'node:fs'
|
|
import path from 'node:path'
|
|
import { spawnSync } from 'node:child_process'
|
|
|
|
const root = process.cwd()
|
|
const electronInstall = path.join(root, 'node_modules', 'electron', 'install.js')
|
|
|
|
const run = (command, args) => {
|
|
const result = spawnSync(command, args, {
|
|
cwd: root,
|
|
stdio: 'inherit',
|
|
env: process.env
|
|
})
|
|
if (result.status !== 0) {
|
|
process.exit(result.status || 1)
|
|
}
|
|
}
|
|
|
|
if (existsSync(electronInstall)) {
|
|
run(process.execPath, [electronInstall])
|
|
}
|
|
|
|
if (process.env.NCURATOR_REBUILD_NATIVE === '1') {
|
|
run(process.execPath, [
|
|
path.join(root, 'scripts', 'build', 'native', 'better-sqlite3.mjs'),
|
|
'prepare'
|
|
])
|
|
run(process.execPath, [path.join(root, 'scripts', 'build', 'native', 'node-pty.mjs'), 'prepare'])
|
|
} else {
|
|
console.log('[postinstall] skip native prepare; set NCURATOR_REBUILD_NATIVE=1 to run it')
|
|
}
|