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

Function CommentCommunity

internal/installer/template.go:45–58  ·  view source on GitHub ↗

CommentCommunity comments out the community cheatpath block in the config template. This is used when the community cheatsheets directory won't exist (either because the user declined to download them, or because the config is being output as an example).

(configs string, confpath string)

Source from the content-addressed store, hash-verified

43// (either because the user declined to download them, or because the config
44// is being output as an example).
45func CommentCommunity(configs string, confpath string) string {
46 community, _, _ := cheatsheetDirs(confpath)
47
48 return strings.ReplaceAll(configs,
49 " - name: community\n"+
50 " path: "+community+"\n"+
51 " tags: [ community ]\n"+
52 " readonly: true",
53 " #- name: community\n"+
54 " # path: "+community+"\n"+
55 " # tags: [ community ]\n"+
56 " # readonly: true",
57 )
58}

Callers 2

cmdInitFunction · 0.92
RunFunction · 0.85

Calls 1

cheatsheetDirsFunction · 0.85

Tested by

no test coverage detected