mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Merge pull request #233 from Aireil/add_fallback_failed_disable
Add a fallback when .disabled file creation fails
This commit is contained in:
commit
c14000f672
1 changed files with 9 additions and 2 deletions
|
|
@ -80,8 +80,15 @@ namespace Dalamud.Plugin
|
||||||
|
|
||||||
// Need to do it with Open so the file handle gets closed immediately
|
// Need to do it with Open so the file handle gets closed immediately
|
||||||
// TODO: Don't use the ".disabled" crap, do it in a config
|
// TODO: Don't use the ".disabled" crap, do it in a config
|
||||||
var disabledFile = File.Open(Path.Combine(outputDir.FullName, ".disabled"), FileMode.Create);
|
try {
|
||||||
disabledFile.Close();
|
File.Open(Path.Combine(outputDir.FullName, ".disabled"), FileMode.Create).Close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.Error(ex, "Could not create the .disabled file, disabling all versions...");
|
||||||
|
foreach (var version in outputDir.Parent.GetDirectories()) {
|
||||||
|
if (!File.Exists(Path.Combine(version.FullName, ".disabled")))
|
||||||
|
File.Open(Path.Combine(version.FullName, ".disabled"), FileMode.Create).Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
thisPlugin.Plugin.Dispose();
|
thisPlugin.Plugin.Dispose();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue