Skip to content

Commit

Permalink
Fix update exercises script (#2314)
Browse files Browse the repository at this point in the history
* Stop no error

* Fix update exercises script
  • Loading branch information
ErikSchierboom authored Oct 20, 2024
1 parent d316983 commit 0175e43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
1 change: 1 addition & 0 deletions bin/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ param (
[string]$Exercise
)

$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true

function Invoke-Build-Generators {
Expand Down
23 changes: 7 additions & 16 deletions bin/update-exercises.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -22,21 +19,15 @@ param (
[Parameter()][switch]$RegenerateTests
)

$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

0 comments on commit 0175e43

Please sign in to comment.