Make sure AssemblyInfo.cs exists when starting from scratch II

This commit is contained in:
niksedk 2015-08-27 23:07:30 +02:00
parent db350534cb
commit 7037fef9e9
2 changed files with 35 additions and 34 deletions

1
.gitignore vendored
View File

@ -25,3 +25,4 @@ SubtitleEdit-*-setup.exe
/src/.nuget/NuGet.exe
/src/.nuget/NuGet.Config
/src/packages/
/libse/Properties/AssemblyInfo.cs

View File

@ -71,8 +71,11 @@ namespace UpdateAssemblyInfo
private static VersionInfo GetOldVersionNumber(string subtitleEditTemplateFileName)
{
var version = new VersionInfo { Version = "1.0.0.0", RevisionGuid = "0" };
var lines = File.ReadAllLines(subtitleEditTemplateFileName.Replace(".template", string.Empty));
var version = new VersionInfo { Version = "1.0.0.0", RevisionGuid = "0", BuildNumber = "0" };
var oldFileName = subtitleEditTemplateFileName.Replace(".template", string.Empty);
if (File.Exists(oldFileName))
{
var lines = File.ReadAllLines(oldFileName);
foreach (var line in lines)
{
var l = line.Trim();
@ -106,9 +109,6 @@ namespace UpdateAssemblyInfo
}
}
}
if (string.IsNullOrWhiteSpace(version.Version))
{
Console.WriteLine("WARNING: Could not find version number - will use 1.0.0");
}
return version;
}