chore: rename project to clawdbot
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env node
|
||||
import process from "node:process";
|
||||
|
||||
declare const __CLAWDIS_VERSION__: string;
|
||||
declare const __CLAWDBOT_VERSION__: string;
|
||||
|
||||
const BUNDLED_VERSION =
|
||||
typeof __CLAWDIS_VERSION__ === "string" ? __CLAWDIS_VERSION__ : "0.0.0";
|
||||
typeof __CLAWDBOT_VERSION__ === "string" ? __CLAWDBOT_VERSION__ : "0.0.0";
|
||||
|
||||
function argValue(args: string[], flag: string): string | undefined {
|
||||
const idx = args.indexOf(flag);
|
||||
@@ -23,7 +23,7 @@ type GatewayWsLogStyle = "auto" | "full" | "compact";
|
||||
|
||||
async function main() {
|
||||
if (hasFlag(args, "--version") || hasFlag(args, "-v")) {
|
||||
// Match `clawdis --version` behavior for Swift env/version checks.
|
||||
// Match `clawdbot --version` behavior for Swift env/version checks.
|
||||
// Keep output a single line.
|
||||
console.log(BUNDLED_VERSION);
|
||||
process.exit(0);
|
||||
@@ -64,7 +64,7 @@ async function main() {
|
||||
const cfg = loadConfig();
|
||||
const portRaw =
|
||||
argValue(args, "--port") ??
|
||||
process.env.CLAWDIS_GATEWAY_PORT ??
|
||||
process.env.CLAWDBOT_GATEWAY_PORT ??
|
||||
(typeof cfg.gateway?.port === "number" ? String(cfg.gateway.port) : "") ??
|
||||
"18789";
|
||||
const port = Number.parseInt(portRaw, 10);
|
||||
@@ -75,7 +75,7 @@ async function main() {
|
||||
|
||||
const bindRaw =
|
||||
argValue(args, "--bind") ??
|
||||
process.env.CLAWDIS_GATEWAY_BIND ??
|
||||
process.env.CLAWDBOT_GATEWAY_BIND ??
|
||||
cfg.gateway?.bind ??
|
||||
"loopback";
|
||||
const bind =
|
||||
@@ -93,7 +93,7 @@ async function main() {
|
||||
}
|
||||
|
||||
const token = argValue(args, "--token");
|
||||
if (token) process.env.CLAWDIS_GATEWAY_TOKEN = token;
|
||||
if (token) process.env.CLAWDBOT_GATEWAY_TOKEN = token;
|
||||
|
||||
let server: Awaited<ReturnType<typeof startGatewayServer>> | null = null;
|
||||
let shuttingDown = false;
|
||||
|
||||
Reference in New Issue
Block a user