-
-
Save chamons/6ea530f4e2f20fc15256b30195c875fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env /Library/Frameworks/Mono.framework/Commands/csharp | |
using System.Diagnostics; | |
using System.IO; | |
foreach (var directory in Directory.EnumerateDirectories ("/System/Library/Frameworks/")) | |
{ | |
string name = directory.Split(new char[] {'/'}).Last().Split(new char [] {'.'}).First(); | |
string framework = Path.Combine (directory, name); | |
if (File.Exists (framework)) | |
{ | |
Console.WriteLine (framework); | |
ProcessStartInfo info = new ProcessStartInfo("/usr/bin/otool", $"-L {framework}") | |
{ | |
RedirectStandardError = true, | |
RedirectStandardOutput = true, | |
UseShellExecute = false, | |
}; | |
Process process = Process.Start(info); | |
string toolOutput = process.StandardOutput.ReadToEnd(); | |
foreach (var line in toolOutput.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) | |
{ | |
if (line.Contains("(compatibility")) | |
{ | |
string depName = line.Split(new string [] {"(compatibility"}, StringSplitOptions.None).First().Replace("\t", ""); | |
Console.WriteLine ("\t" + depName); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment