Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading