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

Function findScript

cli/dotfiles.go:361–368  ·  view source on GitHub ↗

findScript will find the first file that matches the script set.

(scriptSet []string, directory string)

Source from the content-addressed store, hash-verified

359
360// findScript will find the first file that matches the script set.
361func findScript(scriptSet []string, directory string) string {
362 for _, i := range scriptSet {
363 if _, err := os.Stat(filepath.Join(directory, i)); err == nil {
364 return i
365 }
366 }
367 return ""
368}
369
370// isRegular detects if the file exists and is not a symlink.
371func isRegular(to string) (bool, error) {

Callers 1

dotfilesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected