mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 23:02:02 +03:00
refactor: rename to openclaw
This commit is contained in:
+4
-10
@@ -1,17 +1,11 @@
|
||||
import path from "node:path";
|
||||
|
||||
export const DEFAULT_CLI_NAME = "moltbot";
|
||||
export const LEGACY_CLI_NAME = "moltbot";
|
||||
export const DEFAULT_CLI_NAME = "openclaw";
|
||||
|
||||
const KNOWN_CLI_NAMES = new Set([DEFAULT_CLI_NAME, LEGACY_CLI_NAME]);
|
||||
const CLI_PREFIX_RE = /^(?:((?:pnpm|npm|bunx|npx)\s+))?(moltbot|moltbot)\b/;
|
||||
const KNOWN_CLI_NAMES = new Set([DEFAULT_CLI_NAME]);
|
||||
const CLI_PREFIX_RE = /^(?:((?:pnpm|npm|bunx|npx)\s+))?(openclaw)\b/;
|
||||
|
||||
export function resolveCliName(
|
||||
argv: string[] = process.argv,
|
||||
env: Record<string, string | undefined> = process.env as Record<string, string | undefined>,
|
||||
): string {
|
||||
const override = env.MOLTBOT_CLI_NAME?.trim() || env.CLAWDBOT_CLI_NAME?.trim();
|
||||
if (override) return override;
|
||||
export function resolveCliName(argv: string[] = process.argv): string {
|
||||
const argv1 = argv[1];
|
||||
if (!argv1) return DEFAULT_CLI_NAME;
|
||||
const base = path.basename(argv1).trim();
|
||||
|
||||
Reference in New Issue
Block a user