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