Skip to content

Commit 0175e43

Browse files
Fix update exercises script (#2314)
* Stop no error * Fix update exercises script
1 parent d316983 commit 0175e43

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

bin/test.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ param (
2323
[string]$Exercise
2424
)
2525

26+
$ErrorActionPreference = "Stop"
2627
$PSNativeCommandUseErrorActionPreference = $true
2728

2829
function Invoke-Build-Generators {

bin/update-exercises.ps1

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
.EXAMPLE
1212
The example below will update the "acronym" exercise
1313
PS C:\> ./update-exercises.ps1 acronym
14-
.EXAMPLE
15-
The example below will update the "acronym" exercise and regenerate the tests
16-
PS C:\> ./update-exercises.ps1 acronym -RegenerateTests
1714
#>
1815

1916
[CmdletBinding(SupportsShouldProcess)]
@@ -22,21 +19,15 @@ param (
2219
[Parameter()][switch]$RegenerateTests
2320
)
2421

22+
$ErrorActionPreference = "Stop"
2523
$PSNativeCommandUseErrorActionPreference = $true
2624

27-
# Use fetch-configlet and configlet to create the exercise
28-
$extension = if ($IsWindows) { ".exe" } else { "" }
29-
$fetchConfiglet = Join-Path "bin" -ChildPath "fetch-configlet${extension}"
30-
$configlet = Join-Path "bin" -ChildPath "configlet${extension}"
31-
32-
$syncArgs = @("sync", "--docs", "--metadata", "--filepaths", "--update", "--yes")
33-
$generatorArgs = @("run", "--project", "generators")
25+
& bin/fetch-configlet
3426

3527
if ($Exercise) {
36-
$syncArgs += "--exercise ${Exercise}"
37-
$generatorArgs += "--exercise ${Exercise}"
28+
& configlet sync --docs --metadata --filepaths --update --yes --exercise $Exercise
29+
& dotnet run --project generators --exercise $Exercise
30+
} else {
31+
& configlet sync --docs --metadata --filepaths --update --yes
32+
& dotnet run --project generators
3833
}
39-
40-
Start-Process -FilePath $fetchConfiglet -Wait
41-
Start-Process -FilePath $configlet -ArgumentList $syncArgs -Wait
42-
Start-Process "dotnet" -ArgumentList $generatorArgs -Wait

0 commit comments

Comments
 (0)