123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace VersionTool
- {
- class Program
- {
- static void Main(string[] args)
- {
- // args= new string[] { "-f","C:\\Codes\\NewServer\\WingCloudServer", "-v","1.0.0.1"};
- var argstr = string.Empty;
- foreach (var item in args)
- {
- argstr += item + " ";
- }
- Console.WriteLine("VersionTool starting ... args:" + argstr);
- var folder = string.Empty;
- var version = string.Empty;
- if (args.Contains("-f"))
- {
- var folderFlagIndex = Array.IndexOf(args, "-f");
- var folderIndex = folderFlagIndex + 1;
- if (folderIndex < args.Length)
- {
- folder = args[folderIndex];
- }
- }
- if (args.Contains("-v"))
- {
- var versionFlagIndex = Array.IndexOf(args, "-v");
- var versionIndex = versionFlagIndex + 1;
- if (versionIndex < args.Length)
- {
- version = args[versionIndex];
- }
- }
- Console.WriteLine("VersionTool folder:" + folder);
- Console.WriteLine("VersionTool version:" + version);
- if (!string.IsNullOrEmpty(folder) && !string.IsNullOrEmpty(version))
- {
- if (Directory.Exists(folder) && Version.TryParse(version, out _))
- {
- AssemblyUpdater.UpdateVersion(folder, version);
- Console.WriteLine("VersionTool versions updated.");
- }
- }
- Console.WriteLine("VersionTool end.");
- }
- }
- }
|