spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / hooks / git / probes / is-absolute-path / is-absolute-path.ts
9 lines · 357 BRaw
1/**
2 * Whether a line `rev-parse --path-format=absolute` printed is an absolute
3 * path (POSIX or drive-letter), and so neither relative nor an echoed flag.
4 *
5 * @param line one line of rev-parse output
6 * @returns whether it names an absolute path
7 */
8export const isAbsolutePath = (line: string) =>
9 line.startsWith('/') || /^[A-Za-z]:[\\/]/.test(line)