Skip to content

Commit

Permalink
test: uninstall template before installing
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Nov 20, 2023
1 parent 63129d0 commit 7e9b393
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .build/build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ let cleanTest o = getArg "--clean-test" "false" o |> System.Boolean.TryParse ||>
// Constants
let contentBaseDir = slnDir </> "content"
let buildOutputDir = slnDir </> "build"
let packageOutputFile o = buildOutputDir </> sprintf "Bolero.Templates.%s.nupkg" (version o)
let packageName = "Bolero.Templates"
let packageOutputFile o = buildOutputDir </> $"{packageName}.{version o}.nupkg"
let variantsToTest =
[
for pwak, pwav in [("Pwa", "true"); ("NoPwa", "false")] do
Expand Down Expand Up @@ -79,7 +80,9 @@ Target.create "pack" <| fun o ->
Target.description "Test all the template projects by building them."
Target.create "test-build" <| fun o ->
// Install the newly created template
dotnet "new" ["-i"; packageOutputFile o; "--force"]
if (dotnetOutput "new" ["list"]).Contains("bolero-app") then
dotnet "new" ["uninstall"; packageName]
dotnet "new" ["install"; packageOutputFile o; "--force"]

// For each template variant, create and build a new project
let testsDir = slnDir </> "test-build"
Expand Down

0 comments on commit 7e9b393

Please sign in to comment.