MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / parseShellFrontmatter

Function parseShellFrontmatter

src/utils/frontmatterParser.ts:351–370  ·  view source on GitHub ↗
(
  value: unknown,
  source: string,
)

Source from the content-addressed store, hash-verified

349 * and other fields degrade.
350 */
351export function parseShellFrontmatter(
352 value: unknown,
353 source: string,
354): FrontmatterShell | undefined {
355 if (value == null) {
356 return undefined
357 }
358 const normalized = String(value).trim().toLowerCase()
359 if (normalized === '') {
360 return undefined
361 }
362 if ((FRONTMATTER_SHELLS as readonly string[]).includes(normalized)) {
363 return normalized as FrontmatterShell
364 }
365 logForDebugging(
366 `Frontmatter 'shell: ${value}' in ${source} is not recognized. Valid values: ${FRONTMATTER_SHELLS.join(', ')}. Falling back to bash.`,
367 { level: 'warn' },
368 )
369 return undefined
370}

Callers 3

createPluginCommandFunction · 0.85

Calls 1

logForDebuggingFunction · 0.70

Tested by

no test coverage detected