settings updates, fixed

This commit is contained in:
Mark Gregory
2026-08-25 22:42:56 +01:00
parent 34569840ae
commit 36cc32674e
3 changed files with 79 additions and 31 deletions
+54
View File
@@ -0,0 +1,54 @@
import {
existsSync,
readdirSync,
realpathSync,
statSync,
} from 'node:fs';
import { join } from 'node:path';
import { spawnSync } from 'node:child_process';
const modulesPath = join(process.cwd(), 'Modules');
if (!existsSync(modulesPath)) {
process.exit(0);
}
const installed = new Set();
for (const moduleName of readdirSync(modulesPath)) {
const modulePath = join(modulesPath, moduleName);
if (!statSync(modulePath).isDirectory()) {
continue;
}
const packageJson = join(modulePath, 'package.json');
const packageLock = join(modulePath, 'package-lock.json');
if (!existsSync(packageJson) || !existsSync(packageLock)) {
continue;
}
const physicalModulePath = realpathSync(modulePath);
if (installed.has(physicalModulePath)) {
continue;
}
installed.add(physicalModulePath);
console.log(`[Modules] Installing npm dependencies for ${moduleName}...`);
const result = spawnSync(
'npm',
['ci', '--no-audit', '--no-fund'],
{
cwd: modulePath,
stdio: 'inherit',
},
);
if (result.status !== 0) {
process.exit(result.status ?? 1);
}
}