MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / searchFileInOS

Function searchFileInOS

src/toolchain.go:184–209  ·  view source on GitHub ↗

Sucht eine Datei im OS

(file string)

Source from the content-addressed store, hash-verified

182
183// Sucht eine Datei im OS
184func searchFileInOS(file string) (path string) {
185
186 switch runtime.GOOS {
187
188 case "linux", "darwin", "freebsd":
189 var args = file
190 var cmd = exec.Command("which", strings.Split(args, " ")...)
191
192 out, err := cmd.CombinedOutput()
193 if err == nil {
194
195 var slice = strings.Split(strings.Replace(string(out), "\r\n", "\n", -1), "\n")
196
197 if len(slice) > 0 {
198 path = strings.Trim(slice[0], "\r\n")
199 }
200
201 }
202
203 default:
204 return
205
206 }
207
208 return
209}
210
211func removeChildItems(dir string) error {
212

Callers 1

loadSettingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected