- protocol/booter: bits4 handshake, proc surfaces, boot policy v4, telemetry v4 - coreutils: nohup + ensure-man-pages; seed-man-pages fixes for extra pages - kernel-runner: no static node:module (Pear); bare-module createRequire - docs: handbook, reference, ADR, compatibility matrix, verify scripts
30 lines
999 B
JavaScript
30 lines
999 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* If any expected man/pages/*.json is missing (e.g. after adding a command),
|
|
* run seed-man-pages.mjs once so `npm run build` does not fail on ENOENT.
|
|
*/
|
|
import { spawnSync } from 'node:child_process'
|
|
import { existsSync } from 'node:fs'
|
|
import { dirname, join } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
import { COREUTILS_COMMANDS, MAN_EXTRA_PAGES } from '../lib/commands.mjs'
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
const pkgRoot = join(__dirname, '..')
|
|
const pagesDir = join(pkgRoot, 'man/pages')
|
|
|
|
const missing = [...COREUTILS_COMMANDS, ...MAN_EXTRA_PAGES].filter(
|
|
(n) => !existsSync(join(pagesDir, `${n}.json`))
|
|
)
|
|
if (!missing.length) process.exit(0)
|
|
|
|
console.warn(
|
|
`[bare-os-coreutils] man/pages missing (${missing.length}): ${missing.join(', ')}; running seed-man-pages.mjs`
|
|
)
|
|
const r = spawnSync(process.execPath, [join(__dirname, 'seed-man-pages.mjs')], {
|
|
cwd: pkgRoot,
|
|
stdio: 'inherit'
|
|
})
|
|
process.exit(r.status ?? 1)
|