findScript will find the first file that matches the script set.
(scriptSet []string, directory string)
| 359 | |
| 360 | // findScript will find the first file that matches the script set. |
| 361 | func 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. |
| 371 | func isRegular(to string) (bool, error) { |