M3 Integration fixes pass 20
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { execSync } from 'node:child_process';
|
||||
import { execFileSync } from 'node:child_process';
|
||||
|
||||
const modulesDir = path.resolve('Modules');
|
||||
const npmCli = process.env.npm_execpath;
|
||||
|
||||
if (!npmCli || !path.isAbsolute(npmCli) || !fs.existsSync(npmCli)) {
|
||||
throw new Error('npm_execpath must reference an existing absolute npm CLI path.');
|
||||
}
|
||||
|
||||
for (const moduleName of fs.readdirSync(modulesDir)) {
|
||||
|
||||
@@ -23,11 +28,13 @@ for (const moduleName of fs.readdirSync(modulesDir)) {
|
||||
console.log(`Building ${moduleName}`);
|
||||
|
||||
try {
|
||||
execSync(
|
||||
'npm run build',
|
||||
execFileSync(
|
||||
process.execPath,
|
||||
[npmCli, 'run', 'build'],
|
||||
{
|
||||
cwd: modulePath,
|
||||
stdio: 'inherit',
|
||||
env: { ...process.env, PATH: '/usr/bin:/bin' },
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user