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
3527if ($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