MCPcopy Index your code
hub / github.com/cheat/cheat / hasCwdCheatpath

Function hasCwdCheatpath

test/integration/cheatpath_integration_test.go:16–23  ·  view source on GitHub ↗

hasCwdCheatpath checks whether the --directories output contains a cheatpath named "cwd". The output format is "name: path\n" per line (tabwriter-aligned), so we look for a line beginning with "cwd".

(output string)

Source from the content-addressed store, hash-verified

14// cheatpath named "cwd". The output format is "name: path\n" per line
15// (tabwriter-aligned), so we look for a line beginning with "cwd".
16func hasCwdCheatpath(output string) bool {
17 for _, line := range strings.Split(output, "\n") {
18 if strings.HasPrefix(line, "cwd") {
19 return true
20 }
21 }
22 return false
23}
24
25// TestLocalCheatpathIntegration exercises the recursive .cheat directory
26// discovery end-to-end: it builds the real cheat binary, sets up filesystem

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected