mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-15 19:21:08 +00:00
refactor: dedupe config cli command trimmed readers
This commit is contained in:
@@ -4,7 +4,10 @@ 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 {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalString,
|
||||
} from "../shared/string-coerce.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { pathExists } from "../utils.js";
|
||||
@@ -24,7 +27,7 @@ function isCompletionShell(value: string): value is CompletionShell {
|
||||
}
|
||||
|
||||
export function resolveShellFromEnv(env: NodeJS.ProcessEnv = process.env): CompletionShell {
|
||||
const shellPath = env.SHELL?.trim() ?? "";
|
||||
const shellPath = normalizeOptionalString(env.SHELL) ?? "";
|
||||
const shellName = shellPath ? normalizeLowercaseStringOrEmpty(path.basename(shellPath)) : "";
|
||||
if (shellName === "zsh") {
|
||||
return "zsh";
|
||||
|
||||
Reference in New Issue
Block a user