Ensure NuGet.config directory exists

This commit is contained in:
Raul Santos 2022-07-07 00:48:40 +02:00
parent 76d0a99707
commit 1637d0c699
No known key found for this signature in database
GPG key ID: B532473AE3A803E4

View file

@ -99,7 +99,7 @@ namespace GodotTools.Build
if (Utils.OS.IsWindows)
{
// %APPDATA% for both
return new[] {Path.Combine(applicationData, "NuGet", "NuGet.Config")};
return new[] { Path.Combine(applicationData, "NuGet", "NuGet.Config") };
}
var paths = new string[2];
@ -156,6 +156,7 @@ namespace GodotTools.Build
</packageSources>
</configuration>
";
System.IO.Directory.CreateDirectory(Path.GetDirectoryName(nuGetConfigPath));
System.IO.File.WriteAllText(nuGetConfigPath, defaultConfig, Encoding.UTF8); // UTF-8 with BOM
}