From 78e59e1a48e6d9d2583c9adf54422d15e6e7074e Mon Sep 17 00:00:00 2001 From: Death Date: Sat, 7 Oct 2017 17:54:11 -0500 Subject: add version support to zip filenames (#7) --- build/smapi.targets | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'build/smapi.targets') diff --git a/build/smapi.targets b/build/smapi.targets index ab7fb71f..88408994 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -14,8 +14,10 @@ + + data = (IDictionary)new JavaScriptSerializer().DeserializeObject(json); + IDictionary version = (IDictionary)data["Version"]; + + // Store our version numbers for ease of use + int major = (int)version["MajorVersion"]; + int minor = (int)version["MinorVersion"]; + int patch = (int)version["PatchVersion"]; + + string fileName = String.Format("{0}-{1}.{2}.{3}.zip", ModName, major, minor, patch); + // clear old zip file if present - string zipPath = Path.Combine(OutputFolderPath, ModName + ".zip"); + string zipPath = Path.Combine(OutputFolderPath, fileName); if (File.Exists(zipPath)) File.Delete(zipPath); -- cgit