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 {
6363// ref: https://github.com/realm/SwiftLint/blob/main/Plugins/SwiftLintPlugin/Path%2BHelpers.swift
6464extension Path {
6565 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 (
6871 first: self ,
6972 next: { path in
7073 guard path. stem. count > 1 else {
@@ -75,11 +78,17 @@ extension Path {
7578
7679 return path. removingLastComponent ( )
7780 }
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+ }
8190 }
82- return proposedDirectory ? . appending ( subpath : defaultConfigurationFileName )
91+ return nil
8392 }
8493
8594 /// 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