mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 04:31:10 +00:00
refactor: dedupe cli lowercase helpers
This commit is contained in:
@@ -4,6 +4,7 @@ import path from "node:path";
|
||||
import { Command, Option } from "commander";
|
||||
import { resolveStateDir } from "../config/paths.js";
|
||||
import { routeLogsToStderr } from "../logging/console.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { pathExists } from "../utils.js";
|
||||
@@ -24,7 +25,7 @@ function isCompletionShell(value: string): value is CompletionShell {
|
||||
|
||||
export function resolveShellFromEnv(env: NodeJS.ProcessEnv = process.env): CompletionShell {
|
||||
const shellPath = env.SHELL?.trim() ?? "";
|
||||
const shellName = shellPath ? path.basename(shellPath).toLowerCase() : "";
|
||||
const shellName = shellPath ? normalizeLowercaseStringOrEmpty(path.basename(shellPath)) : "";
|
||||
if (shellName === "zsh") {
|
||||
return "zsh";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user