@@ -16,17 +16,19 @@ public enum Runtime {
16
16
}
17
17
18
18
/// Is this a dev build: e.g. running inside a cloned danger/danger-swift
19
- public static let potentialLibraryFolders = [
20
- " .build/debug " , // Working in Xcode / CLI
21
- " .build/x86_64-unknown-linux/debug " , // Danger Swift's CI
22
- " .build/release " , // Testing prod
23
- " /usr/local/lib/danger " , // Intel Homebrew installs lib stuff to here
24
- " /opt/homebrew/lib/danger " , // Apple Silicon Homebrew installs lib stuff to here
25
- ]
19
+ public static func potentialLibraryFolders( forDangerSwiftVersion version: String ) -> [ String ] { [
20
+ " .build/debug " , // Working in Xcode / CLI
21
+ " .build/x86_64-unknown-linux/debug " , // Danger Swift's CI
22
+ " .build/release " , // Testing prod
23
+ " /usr/local/lib/danger " , // Intel Homebrew installs lib stuff to here
24
+ " /opt/homebrew/lib/danger " , // Apple Silicon Homebrew installs lib stuff to here
25
+ NSHomeDirectory ( ) + " .local/share/mise/installs/danger-swift/ \( version) /lib "
26
+ ]
27
+ }
26
28
27
29
/// Finds a path to add at runtime to the compiler, which links
28
30
/// to the library Danger
29
- public static func getLibDangerPath( ) -> String ? {
31
+ public static func getLibDangerPath( forDangerSwiftVersion version : String ) -> String ? {
30
32
let fileManager = FileManager . default
31
33
32
34
// Was danger-swift installed via marathon?
@@ -49,7 +51,7 @@ public enum Runtime {
49
51
} ?? [ ]
50
52
51
53
// Check and find where we can link to libDanger from
52
- let libPaths = commandArgPath + potentialLibraryFolders + depManagerDangerLibPaths
54
+ let libPaths = commandArgPath + potentialLibraryFolders( forDangerSwiftVersion : version ) + depManagerDangerLibPaths
53
55
54
56
func isTheDangerLibPath( path: String ) -> Bool {
55
57
fileManager. fileExists ( atPath: path + " /libDanger.dylib " ) || // OSX
0 commit comments