static bool IsCliLatestVersion()
        {
            var process = new RunProcess(PythonManager.GetPython(), PythonCliParameters.Cli, "--version");

            process.Run();

            if (process.Success)
            {
                var currentVersion = process.Error.Trim();
                Logger.Info(string.Format("Current wakatime-cli version is {0}", currentVersion));

                Logger.Info("Checking for updates to wakatime-cli...");
                var latestVersion = WakaTimeConstants.LatestWakaTimeCliVersion();

                if (currentVersion.Equals(latestVersion))
                {
                    Logger.Info("wakatime-cli is up to date.");
                    return(true);
                }
                else
                {
                    Logger.Info(string.Format("Found an updated wakatime-cli v{0}", latestVersion));
                }
            }
            return(false);
        }
示例#2
0
        static bool IsCliLatestVersion()
        {
            var process = new RunProcess(PythonManager.GetPython(), PythonCliParameters.Cli, "--version");

            process.Run();

            var wakatimeVersion = WakaTimeConstants.CurrentWakaTimeCliVersion();

            return(process.Success && process.Error.Equals(wakatimeVersion));
        }
示例#3
0
        internal static bool IsCliUpToDate()
        {
            var process = new RunProcess(Dependencies.GetPython(), CliLocation, "--version");

            process.Run();

            if (process.Success)
            {
                var currentVersion = process.Error.Trim();
                Logger.Info($"Current wakatime-cli version is {currentVersion}");

                Logger.Info("Checking for updates to wakatime-cli...");
                var latestVersion = WakaTimeConstants.LatestWakaTimeCliVersion();

                if (currentVersion.Equals(latestVersion))
                {
                    Logger.Info("wakatime-cli is up to date.");
                    return(true);
                }

                Logger.Info($"Found an updated wakatime-cli v{latestVersion}");
            }
            return(false);
        }