File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,11 @@ extension RunScriptPlugin: XcodeBuildToolPlugin {
63
63
// ref: https://github.com/realm/SwiftLint/blob/main/Plugins/SwiftLintPlugin/Path%2BHelpers.swift
64
64
extension Path {
65
65
func firstConfigurationFileInParentDirectories( ) -> Path ? {
66
- let defaultConfigurationFileName = " .runscript.yml "
67
- let proposedDirectory = sequence (
66
+ let defaultConfigurationFileNames = [
67
+ " runscript.yml " ,
68
+ " .runscript.yml "
69
+ ]
70
+ let proposedDirectories = sequence (
68
71
first: self ,
69
72
next: { path in
70
73
guard path. stem. count > 1 else {
@@ -75,11 +78,17 @@ extension Path {
75
78
76
79
return path. removingLastComponent ( )
77
80
}
78
- ) . first { path in
79
- let potentialConfigurationFile = path. appending ( subpath: defaultConfigurationFileName)
80
- return potentialConfigurationFile. isAccessible ( )
81
+ )
82
+
83
+ for proposedDirectory in proposedDirectories {
84
+ for fileName in defaultConfigurationFileNames {
85
+ let potentialConfigurationFile = proposedDirectory. appending ( subpath: fileName)
86
+ if potentialConfigurationFile. isAccessible ( ) {
87
+ return potentialConfigurationFile
88
+ }
89
+ }
81
90
}
82
- return proposedDirectory ? . appending ( subpath : defaultConfigurationFileName )
91
+ return nil
83
92
}
84
93
85
94
/// Safe way to check if the file is accessible from within the current process sandbox.
You can’t perform that action at this time.
0 commit comments