MCPcopy Index your code
hub / github.com/coder/coder / FilePathToParts

Function FilePathToParts

agent/agentcontainers/ignore/dir.go:26–40  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

24)
25
26func FilePathToParts(path string) []string {
27 components := []string{}
28
29 if path == "" {
30 return components
31 }
32
33 for segment := range strings.SplitSeq(filepath.Clean(path), string(filepath.Separator)) {
34 if segment != "" {
35 components = append(components, segment)
36 }
37 }
38
39 return components
40}
41
42func readIgnoreFile(fileSystem afero.Fs, path, ignore string) ([]gitignore.Pattern, error) {
43 var ps []gitignore.Pattern

Callers 3

TestFilePathToPartsFunction · 0.92
readIgnoreFileFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFilePathToPartsFunction · 0.74