#!/usr/bin/env node // mosaic business validate // mosaic business resolve [--project ] // // The old spelling's executable (scripts/mosaic business validate|resolve, and the old path // packages/business/src/cli.mjs, which imports this file). The commands live in config-command.mjs, // which `mosaic org config validate|resolve` (packages/cli/src/cli.mjs) calls too; this file only // hands it the process's arguments, streams and environment and sets the exit status. validate loads // the business file, every role definition it uses, the project files that exist under its declared // roots, and stat-checks every credential reference. resolve prints one role instance's resolved // record. Both print JSON on stdout and problems on stderr, each stderr line prefixed // `mosaic business: `, exactly as before stage B. // // Exit codes: 0 ok; 2 invalid (business, role, project file or a credential // reference); 3 system config problem; 4 usage, or a required file missing. import { BUSINESS_CONFIG, runConfigCommand } from "./config-command.mjs"; process.exitCode = runConfigCommand(process.argv.slice(2), { stdout: process.stdout, stderr: process.stderr, env: process.env, spelling: BUSINESS_CONFIG, });