Fix update-dependencies by slimming it way down.
It can no longer be dependent on Cli.Utils, since that will affect which version of NuGet gets used. It's better for this small console app to just depend on VersionTools.
This commit is contained in:
parent
928c510c84
commit
f82fa91f58
5 changed files with 22 additions and 20 deletions
|
@ -1,12 +1,12 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.VersionTools;
|
||||
using Microsoft.DotNet.VersionTools.Automation;
|
||||
using Microsoft.DotNet.VersionTools.Dependencies;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Scripts
|
|||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
DebugHelper.HandleDebugSwitch(ref args);
|
||||
HandleDebugSwitch(ref args);
|
||||
|
||||
bool onlyUpdate = args.Length > 0 && string.Equals("--Update", args[0], StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
|
@ -96,5 +96,21 @@ namespace Microsoft.DotNet.Scripts
|
|||
VersionGroupName = "version"
|
||||
};
|
||||
}
|
||||
|
||||
private static void HandleDebugSwitch(ref string[] args)
|
||||
{
|
||||
if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
args = args.Skip(1).ToArray();
|
||||
WaitForDebugger();
|
||||
}
|
||||
}
|
||||
|
||||
private static void WaitForDebugger()
|
||||
{
|
||||
Console.WriteLine("Waiting for debugger to attach. Press ENTER to continue");
|
||||
Console.WriteLine($"Process ID: {Process.GetCurrentProcess().Id}");
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue