MCPcopy Index your code
hub / github.com/cli/cli / rootDir

Function rootDir

internal/safepaths/absolute_test.go:121–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119}
120
121func rootDir() string {
122 // Get the current working directory
123 cwd, err := os.Getwd()
124 if err != nil {
125 panic(err)
126 }
127
128 // For Windows, extract the volume and add back the root
129 if runtime.GOOS == "windows" {
130 volume := filepath.VolumeName(cwd)
131 return volume + "\\"
132 }
133
134 // For Unix-based systems, the root is always "/"
135 return "/"
136}

Callers 2

TestParseAbsolutePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected