File size: 950 Bytes
fc0f7bd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Validates that the checked in files required for the widget are up to date.
# Specifically, this means that they were regenerated after changes
$widgetstaticpath = 'fairlearn/widget/static'
$tempwidgetstaticpath = 'temp/static'
New-Item -ItemType Directory -Force -Path $tempwidgetstaticpath
Copy-Item $widgetstaticpath -Destination $tempwidgetstaticpath -Recurse
Invoke-Expression "scripts/build-widget.ps1"
Get-ChildItem $tempwidgetstaticpath | ForEach-Object {
filename = [System.IO.Path]::GetFileName($_)
if(Compare-Object -ReferenceObject $(Get-Content $tempwidgetstaticpath/$filename) -DifferenceObject $(Get-Content $widgetstaticpath/$filename)){
throw "Regenerating file " + $widgetstaticpath/$filename + " changed contents. Make sure to generate the widget and check in the generated files."
}
Else {
Write-Host "Regenerating file " + $widgetstaticpath/$filename + " did not change contents."
}
}
|