Don't add a dash to the build number if build quality is not set.

This commit is contained in:
Pranav K 2016-05-06 06:46:20 -07:00
Родитель f00ee8c797
Коммит 620d2b9bd9
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -18,16 +18,18 @@ functions
return version; return version;
} }
private bool _buildQualitySet;
private string _buildQuality; private string _buildQuality;
string BuildQuality string BuildQuality
{ {
get get
{ {
if (_buildQuality == null) if (!_buildQualitySet)
{ {
var buildQualityFilePath = Path.Combine(KoreBuildFolderPath, "build-quality.txt"); var buildQualityFilePath = Path.Combine(KoreBuildFolderPath, "build-quality.txt");
_buildQuality = File.ReadAllText(buildQualityFilePath); _buildQuality = File.ReadAllText(buildQualityFilePath);
_buildQualitySet = true;
} }
return _buildQuality; return _buildQuality;
@ -35,6 +37,7 @@ functions
set set
{ {
_buildQuality = value; _buildQuality = value;
_buildQualitySet = true;
} }
} }
@ -48,7 +51,7 @@ functions
return "t" + DateTime.UtcNow.ToString("yyMMddHHmmss"); return "t" + DateTime.UtcNow.ToString("yyMMddHHmmss");
} }
return BuildQuality + "-" + buildNumber; return !string.IsNullOrEmpty(BuildQuality) ? BuildQuality + "-" + buildNumber : buildNumber;
} }
} }