Skip to content

Commit 60b7735

Browse files
Fix update exercises script
1 parent fcfd482 commit 60b7735

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

bin/update-exercises.ps1

Lines changed: 6 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)]
@@ -25,19 +22,12 @@ param (
2522
$ErrorActionPreference = "Stop"
2623
$PSNativeCommandUseErrorActionPreference = $true
2724

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

3627
if ($Exercise) {
37-
$syncArgs += "--exercise ${Exercise}"
38-
$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
3933
}
40-
41-
Start-Process -FilePath $fetchConfiglet -Wait
42-
Start-Process -FilePath $configlet -ArgumentList $syncArgs -Wait
43-
Start-Process "dotnet" -ArgumentList $generatorArgs -Wait

0 commit comments

Comments
 (0)