Beispiel #1
0
        private void ChangeVersion(string[] arg2)
        {
            string f = arg2[0];
            string versionChangeStr = "X.X.X.+";

            if (arg2.Length != 1)
            {
                versionChangeStr = arg2[1];
            }

            string[] files = { f };
            if (f.EndsWith(".sln"))
            {
                files = Directory.GetFiles(
                    Path.GetDirectoryName(Path.GetFullPath(f)),
                    "*.csproj",
                    SearchOption.AllDirectories
                    );
            }

            foreach (string file in files)
            {
                Version v    = VersionHelperConsole.GetVersionFromFile(file);
                Version newV = VersionHelperConsole.ChangeVersion(v, versionChangeStr);

                Logger.Log(LogType.Log, $"Changing Version {v} => {newV}", 1);

                if (ToFileCommand.File != null)
                {
                    File.WriteAllText(ToFileCommand.File, newV.ToString());
                }

                VersionHelperConsole.ChangeVersionInFile(file, newV);
            }
        }
Beispiel #2
0
        private void ChangeVersion(string[] arg2)
        {
            string file             = arg2[0];
            string versionChangeStr = "X.X.X.+";

            if (arg2.Length != 1)
            {
                versionChangeStr = arg2[1];
            }

            Version v    = VersionHelperConsole.GetVersionFromFile(file);
            Version newV = VersionHelperConsole.ChangeVersion(v, versionChangeStr);

            Logger.Log(LogType.Log, $"Changing Version {v} => {newV}", 1);

            VersionHelperConsole.ChangeVersionInFile(file, newV);
        }