mirror of
https://github.com/frida/frida-node.git
synced 2026-11-07 09:35:57 -10:00
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]>
25 lines
518 B
JavaScript
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);
|