예제 #1
0
        private static void Main(string[] args)
        {
            var versionProvider = new CleanCodeToolVersionProvider();

            versionProvider.GetLastVersion()
            .Then(
                meta => versionProvider.DownloadAndExtractToDirectory(meta, CliDirectory.WithSubDirectory("Tool")))
            .Then(_ => CreateRunFile())
            .Then(_ => SetToPathIfNeed())
            .OnFail(ConsoleHelper.LogError);
        }
예제 #2
0
        private static bool NewVersionWasInstalled()
        {
            var versionProvider = new CleanCodeToolVersionProvider(IsDeveloperMode());

            return(versionProvider.GetLastVersion()
                   .Then(meta =>
            {
                if (meta.Version.Equals(CurrentVersion))
                {
                    return false;
                }

                return versionProvider
                .DownloadAndExtractToDirectory(meta, CliDirectory.WithSubDirectory("new-tool"))
                .Then(_ => true);
            })
                   .OnFail(ConsoleHelper.LogError)
                   .GetValueOrThrow());
        }