Skip to content

Commit

Permalink
Merge pull request #248 from yonaskolb/fix_mint_installation
Browse files Browse the repository at this point in the history
Fix mint installation not reading setting presets
  • Loading branch information
yonaskolb authored Feb 26, 2018
2 parents 9d4950e + 42ca282 commit 3c8ebba
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Sources/XcodeGenKit/SettingsBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,21 @@ extension SettingsPresetFile {
if let group = settingPresetSettings[path] {
return group
}
let relativePath = "SettingPresets/\(path).yml"
let possibleSettingsPaths: [Path] = [
Path(relativePath),
Path(Bundle.main.bundlePath) + relativePath,
Path(Bundle.main.bundlePath) + "../share/xcodegen/\(relativePath)",
let bundlePath = Path(Bundle.main.bundlePath)
let relativePath = Path("SettingPresets/\(path).yml")
var possibleSettingsPaths: [Path] = [
relativePath,
bundlePath + relativePath,
bundlePath + "../share/xcodegen/\(relativePath)",
Path(#file).parent().parent().parent() + relativePath,
]

if let symlink = try? bundlePath.symlinkDestination() {
possibleSettingsPaths = [
symlink + relativePath
] + possibleSettingsPaths
}

guard let settingsPath = possibleSettingsPaths.first(where: { $0.exists }) else {
switch self {
case .base, .config, .platform:
Expand Down

0 comments on commit 3c8ebba

Please sign in to comment.