MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isNormalizedCdCommand

Function isNormalizedCdCommand

src/tools/BashTool/bashPermissions.ts:2603–2611  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

2601 * DIRECTORY_CHANGE_ALIASES (src/utils/powershell/parser.ts).
2602 */
2603export function isNormalizedCdCommand(command: string): boolean {
2604 const stripped = stripSafeWrappers(command)
2605 const parsed = tryParseShellCommand(stripped)
2606 if (parsed.success && parsed.tokens.length > 0) {
2607 const cmd = parsed.tokens[0]
2608 return cmd === 'cd' || cmd === 'pushd' || cmd === 'popd'
2609 }
2610 return /^(?:cd|pushd|popd)(?:\s|$)/.test(stripped)
2611}
2612
2613/**
2614 * Checks if a compound command contains any cd command,

Callers 2

bashToolHasPermissionFunction · 0.85
commandHasAnyCdFunction · 0.85

Calls 2

stripSafeWrappersFunction · 0.85
tryParseShellCommandFunction · 0.85

Tested by

no test coverage detected