mirror of
https://github.com/frida/frida-node.git
synced 2026-11-08 17:12:59 -10:00
Using executable scripts with shebang is risky on UNIX, where python3
may not be present. Instead, use find_program('python3'), which Meson
provides a fallback for if it cannot find it in the environment.
24 lines
476 B
JavaScript
24 lines
476 B
JavaScript
const { execSync } = require('child_process');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const pkgRoot = path.dirname(path.dirname(__filename));
|
|
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);
|