예제 #1
0
        private static void PaketSimplify(RunnerArgs runnerArgs, CancellationToken cancellationToken, string rootDir, PaketInfo paketInfo, AdditionalArgs additionalArgs)
        {
            if (runnerArgs.SimplifyInteractive || runnerArgs.Simplify)
            {
                if (runnerArgs.Reinstall || (string.IsNullOrWhiteSpace(runnerArgs.UpdatePackage) && !runnerArgs.Update))
                {
                    Console.WriteLine("Need to install before we can simplify");
                    Console.WriteLine("-----------------------------------------------------");
                    PaketInstall(runnerArgs, cancellationToken, rootDir, paketInfo, additionalArgs);
                }

                if (runnerArgs.SimplifyInteractive)
                {
                    ConsoleHelper.RunPaketCommand(rootDir, paketInfo.PaketPath, paketInfo.ToolType, "simplify", $"--interactive {additionalArgs.PaketVerboseArgs} {runnerArgs.SimplifyArgs}", cancellationToken);
                    Console.WriteLine("-----------------------------------------------------");
                }
                else if (runnerArgs.Simplify)
                {
                    ConsoleHelper.RunPaketCommand(rootDir, paketInfo.PaketPath, paketInfo.ToolType, "simplify", $"{additionalArgs.PaketVerboseArgs} {runnerArgs.SimplifyArgs}", cancellationToken);
                    Console.WriteLine("-----------------------------------------------------");
                }
            }
        }
예제 #2
0
 private static void PaketRestore(RunnerArgs runnerArgs, CancellationToken cancellationToken, string rootDir, PaketInfo paketInfo, AdditionalArgs additionalArgs)
 {
     if (runnerArgs.Restore)
     {
         if (runnerArgs.Install || runnerArgs.Reinstall || runnerArgs.Simplify || runnerArgs.SimplifyInteractive)
         {
             Console.WriteLine("Skipping Restore as already installed");
             Console.WriteLine("-----------------------------------------------------");
         }
         else
         {
             ConsoleHelper.RunPaketCommand(rootDir, paketInfo.PaketPath, paketInfo.ToolType, "restore", $"{additionalArgs.PaketForceArgs} {additionalArgs.PaketVerboseArgs} {runnerArgs.RestoreArgs}", cancellationToken);
             Console.WriteLine("-----------------------------------------------------");
         }
     }
 }
예제 #3
0
        private static void PaketUpdate(RunnerArgs runnerArgs, CancellationToken cancellationToken, string rootDir, PaketInfo paketInfo, AdditionalArgs additionalArgs)
        {
            if ((!string.IsNullOrWhiteSpace(runnerArgs.UpdatePackage) || runnerArgs.Update) && runnerArgs.Reinstall)
            {
                Console.WriteLine("Skipping Update as reinstall install newest versions");
                Console.WriteLine("-----------------------------------------------------");
                return;
            }

            if (!string.IsNullOrWhiteSpace(runnerArgs.UpdatePackage))
            {
                ConsoleHelper.RunPaketCommand(rootDir, paketInfo.PaketPath, paketInfo.ToolType, "update", $"{runnerArgs.UpdatePackage} {additionalArgs.PaketRedirectArgs} {additionalArgs.PaketForceArgs} {additionalArgs.PaketVerboseArgs} {runnerArgs.UpdateArgs}", cancellationToken);
                Console.WriteLine("-----------------------------------------------------");
            }
            else if (runnerArgs.Update)
            {
                ConsoleHelper.RunPaketCommand(rootDir, paketInfo.PaketPath, paketInfo.ToolType, "update", $"{additionalArgs.PaketRedirectArgs} {additionalArgs.PaketForceArgs} {additionalArgs.PaketVerboseArgs} {runnerArgs.UpdateArgs}", cancellationToken);
                Console.WriteLine("-----------------------------------------------------");
            }
        }
예제 #4
0
 private static void CacheClean(RunnerArgs runnerArgs, CancellationToken cancellationToken, string rootDir, PaketInfo paketInfo, AdditionalArgs additionalArgs)
 {
     if (runnerArgs.ClearCache)
     {
         ConsoleHelper.RunPaketCommand(rootDir, paketInfo.PaketPath, paketInfo.ToolType, "clear-cache", $"--clear-local {additionalArgs.PaketVerboseArgs}", cancellationToken);
         Console.WriteLine("-----------------------------------------------------");
     }
 }
예제 #5
0
 private static void PaketRemove(RunnerArgs runnerArgs, CancellationToken cancellationToken, string rootDir, PaketInfo paketInfo, AdditionalArgs additionalArgs)
 {
     if (!string.IsNullOrWhiteSpace(runnerArgs.RemovePackageInteractive))
     {
         ConsoleHelper.RunPaketCommand(rootDir, paketInfo.PaketPath, paketInfo.ToolType, "remove", $"{runnerArgs.RemovePackage} --interactive {additionalArgs.PaketForceArgs} {additionalArgs.PaketVerboseArgs} {runnerArgs.RemoveAdditionalArgs}", cancellationToken);
         Console.WriteLine("-----------------------------------------------------");
     }
     else if (!string.IsNullOrWhiteSpace(runnerArgs.RemovePackage))
     {
         if (runnerArgs.RemoveProjects != null && runnerArgs.RemoveProjects.Any(x => !string.IsNullOrWhiteSpace(x)))
         {
             foreach (var removeProject in runnerArgs.RemoveProjects.Where(x => !string.IsNullOrWhiteSpace(x)))
             {
                 ConsoleHelper.RunPaketCommand(rootDir, paketInfo.PaketPath, paketInfo.ToolType, "remove", $"{runnerArgs.RemovePackage} --project {removeProject} {additionalArgs.PaketForceArgs} {additionalArgs.PaketVerboseArgs} {runnerArgs.RemoveAdditionalArgs}", cancellationToken);
                 Console.WriteLine("-----------------------------------------------------");
             }
         }
         else
         {
             ConsoleHelper.RunPaketCommand(rootDir, paketInfo.PaketPath, paketInfo.ToolType, "remove", $"{runnerArgs.RemovePackage} {additionalArgs.PaketForceArgs} {additionalArgs.PaketVerboseArgs} {runnerArgs.RemoveAdditionalArgs}", cancellationToken);
             Console.WriteLine("-----------------------------------------------------");
         }
     }
 }
예제 #6
0
        private static void UpdatePaketTool(RunnerArgs runnerArgs, CancellationToken cancellationToken, string rootDir, PaketInfo paketInfo, AdditionalArgs additionalArgs)
        {
            if (runnerArgs.UpdateTool)
            {
                switch (paketInfo.ToolType)
                {
                case PaketType.LocalTool:
                    ConsoleHelper.RunDotNetToolCommand(rootDir, $"update paket {additionalArgs.DotnetVerboseArgs}", cancellationToken);
                    break;

                case PaketType.GlobalTool:
                    ConsoleHelper.RunDotNetToolCommand(rootDir, $"update paket --global {additionalArgs.DotnetVerboseArgs}", cancellationToken);
                    break;

                default:
                    Console.WriteLine("Cannot update local exe using paket chain");
                    break;
                }

                Console.WriteLine("-----------------------------------------------------");
            }
        }
예제 #7
0
 private static void RestoreLocalTool(CancellationToken cancellationToken, string rootDir, PaketInfo paketInfo, AdditionalArgs additionalArgs)
 {
     if (paketInfo.ToolType == PaketType.LocalTool)
     {
         Console.WriteLine("Running tool restore");
         ConsoleHelper.RunDotNetToolCommand(rootDir, $"restore {additionalArgs.DotnetVerboseArgs}", cancellationToken);
         Console.WriteLine("-----------------------------------------------------");
     }
 }