From fcfd482a897f3b821e139faa5e043f60833bac74 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Sun, 20 Oct 2024 11:00:18 +0200 Subject: [PATCH 1/2] Stop no error --- bin/test.ps1 | 1 + bin/update-exercises.ps1 | 1 + 2 files changed, 2 insertions(+) diff --git a/bin/test.ps1 b/bin/test.ps1 index 1d7199b27a..914079ceac 100644 --- a/bin/test.ps1 +++ b/bin/test.ps1 @@ -23,6 +23,7 @@ param ( [string]$Exercise ) +$ErrorActionPreference = "Stop" $PSNativeCommandUseErrorActionPreference = $true function Invoke-Build-Generators { diff --git a/bin/update-exercises.ps1 b/bin/update-exercises.ps1 index 6543af75cf..be6ee6e71d 100644 --- a/bin/update-exercises.ps1 +++ b/bin/update-exercises.ps1 @@ -22,6 +22,7 @@ param ( [Parameter()][switch]$RegenerateTests ) +$ErrorActionPreference = "Stop" $PSNativeCommandUseErrorActionPreference = $true # Use fetch-configlet and configlet to create the exercise From 60b77354ebcdead83712dcd7fc23c5577114ab4c Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Sun, 20 Oct 2024 11:04:55 +0200 Subject: [PATCH 2/2] Fix update exercises script --- bin/update-exercises.ps1 | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/bin/update-exercises.ps1 b/bin/update-exercises.ps1 index be6ee6e71d..c19da5bb2f 100644 --- a/bin/update-exercises.ps1 +++ b/bin/update-exercises.ps1 @@ -11,9 +11,6 @@ .EXAMPLE The example below will update the "acronym" exercise PS C:\> ./update-exercises.ps1 acronym -.EXAMPLE - The example below will update the "acronym" exercise and regenerate the tests - PS C:\> ./update-exercises.ps1 acronym -RegenerateTests #> [CmdletBinding(SupportsShouldProcess)] @@ -25,19 +22,12 @@ param ( $ErrorActionPreference = "Stop" $PSNativeCommandUseErrorActionPreference = $true -# Use fetch-configlet and configlet to create the exercise -$extension = if ($IsWindows) { ".exe" } else { "" } -$fetchConfiglet = Join-Path "bin" -ChildPath "fetch-configlet${extension}" -$configlet = Join-Path "bin" -ChildPath "configlet${extension}" - -$syncArgs = @("sync", "--docs", "--metadata", "--filepaths", "--update", "--yes") -$generatorArgs = @("run", "--project", "generators") +& bin/fetch-configlet if ($Exercise) { - $syncArgs += "--exercise ${Exercise}" - $generatorArgs += "--exercise ${Exercise}" + & configlet sync --docs --metadata --filepaths --update --yes --exercise $Exercise + & dotnet run --project generators --exercise $Exercise +} else { + & configlet sync --docs --metadata --filepaths --update --yes + & dotnet run --project generators } - -Start-Process -FilePath $fetchConfiglet -Wait -Start-Process -FilePath $configlet -ArgumentList $syncArgs -Wait -Start-Process "dotnet" -ArgumentList $generatorArgs -Wait