File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -93,16 +93,17 @@ extension SettingsPresetFile {
9393 return group
9494 }
9595 let relativePath = " SettingPresets/ \( path) .yml "
96- var settingsPath = Path ( Bundle . main. bundlePath) + " ../share/xcodegen/ \( relativePath) "
97-
98- if !settingsPath. exists {
99- // maybe running locally
100- settingsPath = Path ( #file) . parent ( ) . parent ( ) . parent ( ) + relativePath
101- }
102- guard settingsPath. exists else {
96+ let possibleSettingsPaths : [ Path ] = [
97+ Path ( relativePath) ,
98+ Path ( Bundle . main. bundlePath) + relativePath,
99+ Path ( Bundle . main. bundlePath) + " ../share/xcodegen/ \( relativePath) " ,
100+ Path ( #file) . parent ( ) . parent ( ) . parent ( ) + relativePath,
101+ ]
102+
103+ guard let settingsPath = possibleSettingsPaths. first ( where: { $0. exists } ) else {
103104 switch self {
104105 case . base, . config, . platform:
105- print ( " No \" \( name) \" settings found at \( settingsPath ) " )
106+ print ( " No \" \( name) \" settings found " )
106107 case . product, . productPlatform:
107108 break
108109 }
You can’t perform that action at this time.
0 commit comments