Skip to content

Commit 6f0ef1b

Browse files
committed
Dotnet uninstall command changes
1 parent 49914d4 commit 6f0ef1b

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/app/Fake.DotNet.Cli/DotNet.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,13 +2047,13 @@ module DotNet =
20472047
__.MarkSuccess()
20482048

20492049
/// <summary>
2050-
/// Execute dotnet new <c>--uninstall &lt;PATH|NUGET_ID&gt;</c> command to uninstall a new template
2050+
/// Execute dotnet new <c>uninstall &lt;PATH|NUGET_ID&gt;</c> command to uninstall a new template
20512051
/// </summary>
20522052
///
20532053
/// <param name="templateName">template short name to uninstall</param>
20542054
/// <param name="setParams">set version command parameters</param>
20552055
let uninstallTemplate templateName =
2056-
use __ = Trace.traceTask "DotNet:new" "dotnet new --uninstall command"
2056+
use __ = Trace.traceTask "DotNet:new" "dotnet new uninstall command"
20572057
let param = TemplateUninstallOptions.Create(templateName)
20582058
let args = buildTemplateUninstallArgs param
20592059
let result = execArgsList (fun _ -> param.Common) "new" args
@@ -2070,6 +2070,6 @@ module DotNet =
20702070

20712071
match success with
20722072
| true -> ()
2073-
| false -> failwithf $"dotnet new --uninstall failed with code %i{result.ExitCode}"
2073+
| false -> failwithf $"dotnet new uninstall failed with code %i{result.ExitCode}"
20742074

20752075
__.MarkSuccess()

src/test/Fake.Core.UnitTests/Fake.DotNet.Cli.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ let tests =
122122

123123
Expect.equal cli expected "New --install args generated correctly."
124124

125-
testCase "Test that the dotnet new --uninstall command works as expected"
125+
testCase "Test that the dotnet new uninstall command works as expected"
126126
<| fun _ ->
127127
let param = DotNet.TemplateUninstallOptions.Create("my-awesome-template")
128128
let cli = param |> DotNet.buildTemplateUninstallArgs |> Args.toWindowsCommandLine
129129

130-
let expected = "--uninstall my-awesome-template"
130+
let expected = "uninstall my-awesome-template"
131131

132-
Expect.equal cli expected "New --uninstall args generated correctly."
132+
Expect.equal cli expected "New uninstall args generated correctly."
133133

134134
testCase "Test buildAfterArgs with no after args"
135135
<| fun _ ->

src/test/Fake.DotNet.Cli.IntegrationTests/TemplateTests.fs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,6 @@ let fileExists dir fileName =
132132
let setupTemplate () =
133133
Process.setEnableProcessTracing true
134134

135-
try
136-
DotNet.uninstallTemplate templatePackageName
137-
with exn ->
138-
$"should clear out preexisting templates\nDebugging Info: {getDebuggingInfo ()}"
139-
|> Expect.isTrue false
140-
141-
printfn $"{Environment.CurrentDirectory}"
142-
143-
DotNet.setupEnv dotnetSdk.Value
144-
145135
let templateNupkg =
146136
GlobbingPattern.create "../../../release/dotnetcore/fake-template.*.nupkg"
147137
|> GlobbingPattern.setBaseDir __SOURCE_DIRECTORY__
@@ -154,6 +144,16 @@ let setupTemplate () =
154144
| Some t -> t
155145
| Option.None -> templatePackageName
156146

147+
try // Specs have changed: needs full package name: https://github.com/dotnet/docs/pull/3054
148+
DotNet.uninstallTemplate fakeTemplateName
149+
with exn ->
150+
$"should clear out preexisting templates\nDebugging Info: {getDebuggingInfo ()}"
151+
|> Expect.isTrue false
152+
153+
printfn $"{Environment.CurrentDirectory}"
154+
155+
DotNet.setupEnv dotnetSdk.Value
156+
157157
try
158158
DotNet.installTemplate fakeTemplateName id
159159
with exn ->

0 commit comments

Comments
 (0)