Skip to content

Commit cace15c

Browse files
author
ENDAVA\mzorec
committed
Adds version check
1 parent 89698b4 commit cace15c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/FlubuCore/Tasks/Packaging/PackageTask.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,15 @@ protected override int DoExecute(ITaskContextInternal context)
237237
zipFile = zipFile.Substring(0, zipFile.Length - 4);
238238
}
239239

240+
if (_addVersionAsPostFixToZipFileName)
241+
{
242+
var version = context.Properties.GetBuildVersion().Version;
243+
if (version == null)
244+
{
245+
throw new TaskExecutionException("Context property ""Build version must be set when adding version as postfix to filename", 99);
246+
}
247+
}
248+
240249
string tmp = _addVersionAsPostFixToZipFileName
241250
? $"{zipFile}_{context.Properties.GetBuildVersion().Version.ToString(_versionFieldCount)}.zip"
242251
: $"{zipFile}.zip";

0 commit comments

Comments
 (0)