File tree 1 file changed +10
-10
lines changed
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,16 @@ func ValidateContextDirectory(srcPath string, excludes []string) error {
29
29
return err
30
30
}
31
31
return filepath .Walk (contextRoot , func (filePath string , f os.FileInfo , err error ) error {
32
+ if err != nil {
33
+ if os .IsPermission (err ) {
34
+ return fmt .Errorf ("can't stat '%s'" , filePath )
35
+ }
36
+ if os .IsNotExist (err ) {
37
+ return nil
38
+ }
39
+ return err
40
+ }
41
+
32
42
// skip this directory/file if it's not in the path, it won't get added to the context
33
43
if relFilePath , err := filepath .Rel (contextRoot , filePath ); err != nil {
34
44
return err
@@ -41,16 +51,6 @@ func ValidateContextDirectory(srcPath string, excludes []string) error {
41
51
return nil
42
52
}
43
53
44
- if err != nil {
45
- if os .IsPermission (err ) {
46
- return fmt .Errorf ("can't stat '%s'" , filePath )
47
- }
48
- if os .IsNotExist (err ) {
49
- return nil
50
- }
51
- return err
52
- }
53
-
54
54
// skip checking if symlinks point to non-existing files, such symlinks can be useful
55
55
// also skip named pipes, because they hanging on open
56
56
if f .Mode ()& (os .ModeSymlink | os .ModeNamedPipe ) != 0 {
You can’t perform that action at this time.
0 commit comments