MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / IsChiefIgnored

Function IsChiefIgnored

internal/git/gitignore.go:14–21  ·  view source on GitHub ↗

IsChiefIgnored checks if .chief is gitignored either locally or globally. Returns true if .chief is already ignored, false otherwise.

(dir string)

Source from the content-addressed store, hash-verified

12// IsChiefIgnored checks if .chief is gitignored either locally or globally.
13// Returns true if .chief is already ignored, false otherwise.
14func IsChiefIgnored(dir string) bool {
15 // Use git check-ignore which respects both local and global gitignore
16 cmd := exec.Command("git", "check-ignore", "-q", ".chief")
17 cmd.Dir = dir
18 err := cmd.Run()
19 // Exit code 0 means it IS ignored, exit code 1 means it's NOT ignored
20 return err == nil
21}
22
23// AddChiefToGitignore adds .chief to the local .gitignore file.
24// Creates the file if it doesn't exist.

Callers 1

runTUIWithOptionsFunction · 0.92

Calls 1

RunMethod · 0.80

Tested by

no test coverage detected