private static FileStream AcquireConsoleBuildLock() {
var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "/ModCompile/buildlock";
bool first = true;
while (true) {
try
{
return new FileStream(path, FileMode.OpenOrCreate);
}
catch (IOException) {
if (first) {
Console.WriteLine("Waiting for other builds to complete");
first = false;
}
}
}
}
}