Add cli/ package with initial scaffolding. Add config-schema to shared package for typed configuration. Add server config-file loader for paperclip.config.ts support. Register cli in pnpm workspace. Add .paperclip/ and .pnpm-store/ to gitignore. Minor Companies page fix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
675 B
TypeScript
25 lines
675 B
TypeScript
import type { PaperclipConfig } from "../config/schema.js";
|
|
import { checkPort } from "../utils/net.js";
|
|
import type { CheckResult } from "./index.js";
|
|
|
|
export async function portCheck(config: PaperclipConfig): Promise<CheckResult> {
|
|
const port = config.server.port;
|
|
const result = await checkPort(port);
|
|
|
|
if (result.available) {
|
|
return {
|
|
name: "Server port",
|
|
status: "pass",
|
|
message: `Port ${port} is available`,
|
|
};
|
|
}
|
|
|
|
return {
|
|
name: "Server port",
|
|
status: "warn",
|
|
message: result.error ?? `Port ${port} is not available`,
|
|
canRepair: false,
|
|
repairHint: `Check what's using port ${port} with: lsof -i :${port}`,
|
|
};
|
|
}
|