Files
frida-node/scripts/install.js
T
Ole André Vadla Ravnås 025b422cfe meson: Rework the script execution logic
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.
2024-04-23 10:50:51 +02:00

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);