diff --git a/scripts/plugins-check.ts b/scripts/plugins-check.ts index 4ea24a82..54728c19 100644 --- a/scripts/plugins-check.ts +++ b/scripts/plugins-check.ts @@ -25,7 +25,7 @@ that running the check can never be the thing that changes your tree. */ -import { readdirSync, existsSync } from 'node:fs'; +import { readdirSync, existsSync, statSync } from 'node:fs'; import { join } from 'node:path'; /* @@ -52,7 +52,19 @@ type Problem = { plugin: string; what: string; fix?: () => void }; const problems: Problem[] = []; const dirs = readdirSync(PLUGINS_DIR, { withFileTypes: true }) - .filter((e) => e.isDirectory() && !e.name.startsWith('.') && e.name !== 'node_modules') + // `statSync().isDirectory()`, not the dirent's — a Dirent for a SYMLINK to a directory answers false to + // `isDirectory()` and true to `isSymbolicLink()`, so filtering on the dirent silently skips every + // symlinked plugin. `platform/plugins/` is symlinks into the workspace clones since 2026-08-27, which + // would have made this report "0 plugin repositories, all well-formed" — a green check over nothing. + // `discover.ts` already does it this way, at line 239, for the same reason. + .filter((e) => !e.name.startsWith('.') && e.name !== 'node_modules') + .filter((e) => { + try { + return statSync(join(PLUGINS_DIR, e.name)).isDirectory(); + } catch { + return false; // a broken symlink, which the checks below have nothing useful to say about + } + }) .map((e) => e.name) .filter((name) => existsSync(join(PLUGINS_DIR, name, '.git'))) .sort(); diff --git a/src/servers/app-store/pm2.ts b/src/servers/app-store/pm2.ts index c8f8136f..8e6a7d67 100644 --- a/src/servers/app-store/pm2.ts +++ b/src/servers/app-store/pm2.ts @@ -63,6 +63,8 @@ export async function startProcess(name: string, cwd: string): Promise { + const { code, out } = await pm2(['save'], cwd); + if (code !== 0) console.error(`[pm2] could not save the process list — a reboot may not restore it: ${out}`); +} + /** 'online' | 'stopped' | 'errored' | … , or null when PM2 has never heard of it. */ export async function processStatus(name: string, cwd: string): Promise { const { code, out } = await pm2(['jlist'], cwd);