Skip to content

Commit 9fc98ba

Browse files
Merge pull request #1 from HughesMDflyer4/dev
Removed unnecessary check if layout.json exists before writing, changed filename checks to ignore case
2 parents 6ac5177 + 0880978 commit 9fc98ba

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

MSFS Layout Generator/Program.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static void Main(string[] layoutPaths)
2525
string layoutPath = Path.GetFullPath(path);
2626
string json;
2727

28-
if (Path.GetFileName(layoutPath) == "layout.json")
28+
if (string.Equals(Path.GetFileName(layoutPath), "layout.json", StringComparison.OrdinalIgnoreCase))
2929
{
3030
foreach (string file in Directory.GetFiles(Path.GetDirectoryName(layoutPath), "*.*", SearchOption.AllDirectories))
3131
{
@@ -36,13 +36,13 @@ static void Main(string[] layoutPaths)
3636
content.Size = new FileInfo(file).Length;
3737
content.Date = new FileInfo(file).LastWriteTimeUtc.ToFileTimeUtc();
3838

39-
if (!relativePath.StartsWith("_CVT_") && relativePath != "Business.json" && relativePath != "layout.json" && relativePath != "manifest.json")
39+
if (!relativePath.StartsWith("_CVT_", StringComparison.OrdinalIgnoreCase) && !string.Equals(relativePath, "business.json") && !string.Equals(relativePath, "layout.json") && !string.Equals(relativePath, "manifest.json"))
4040
{
4141
layout.Content.Add(content);
4242
}
4343
}
4444

45-
if(layout.Content.Count() == 0)
45+
if (layout.Content.Count() == 0)
4646
{
4747
Utilities.Log("No files were found in the folder containing \"" + layoutPath + "\". The layout.json will not be updated.");
4848
}
@@ -55,11 +55,6 @@ static void Main(string[] layoutPaths)
5555

5656
try
5757
{
58-
if (!File.Exists(layoutPath))
59-
{
60-
File.Create(layoutPath).Close();
61-
}
62-
6358
File.WriteAllText(layoutPath, json.Replace("\r\n", "\n"));
6459
}
6560
catch (Exception ex)

MSFS Layout Generator/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("1.0.1.0")]
36+
[assembly: AssemblyFileVersion("1.0.1.0")]

0 commit comments

Comments
 (0)