Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mint installation not reading setting presets #248

Merged
merged 1 commit into from
Feb 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you demand other mint supporting repositories to manually follow symlink?
As I suggested in yonaskolb/Mint#53 , it should be more simple.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, each library shouldn't have to do this. Replying in other issue

}

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