Files
frida-node/scripts/install.js
T
Ole André Vadla RavnåsandHåvard Sørbø e2ffd0aa6c Auto-generate Node-API bindings from .gir
Which means API changes in frida-core are instantly reflected, with only
customizations needing tweaking, if applicable.

And, since we now target Node-API there will now only be one prebuilt
binary per OS/ABI.

Co-authored-by: Håvard Sørbø <[email protected]>
2025-05-08 10:05:20 +02:00

25 lines
518 B
JavaScript

import { execSync } from 'child_process';
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const pkgRoot = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
const binding = path.join(pkgRoot, 'build', 'frida_binding.node');
if (fs.existsSync(binding)) {
process.exit(0);
}
try {
execSync('prebuild-install', { stdio: 'inherit' });
process.exit(0);
} catch (e) {
}
try {
execSync('make', { stdio: 'inherit' });
process.exit(0);
} catch (e) {
}
process.exit(1);