File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 55 "log/slog"
66 "os"
77 "path/filepath"
8+ "slices"
89 "strings"
910
1011 "github.com/deckhouse/deckhouse/pkg/log"
@@ -32,16 +33,17 @@ func CheckExecutablePermissions(f os.FileInfo) error {
3233
3334// RecursiveGetExecutablePaths finds recursively all executable files
3435// inside a dir directory. Hidden directories and files are ignored.
35- func RecursiveGetExecutablePaths (dir string ) ([]string , error ) {
36+ func RecursiveGetExecutablePaths (dir string , excludedDirs ... string ) ([]string , error ) {
3637 paths := make ([]string , 0 )
38+ excludedDirs = append (excludedDirs , "lib" )
3739 err := filepath .Walk (dir , func (path string , f os.FileInfo , err error ) error {
3840 if err != nil {
3941 return err
4042 }
4143
4244 if f .IsDir () {
4345 // Skip hidden and lib directories inside initial directory
44- if strings .HasPrefix (f .Name (), "." ) || f .Name () == "lib" {
46+ if strings .HasPrefix (f .Name (), "." ) || slices . Contains ( excludedDirs , f .Name ()) {
4547 return filepath .SkipDir
4648 }
4749
You can’t perform that action at this time.
0 commit comments