Compile all devices script (#23)

This commit is contained in:
Chris Nussbaum 2021-09-17 11:19:49 -05:00 committed by GitHub
parent c5b88c0c6f
commit 876fc3ba81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,22 @@
Push-Location $PSScriptRoot\..\devices
$files = Get-ChildItem "*.yaml" -Exclude "secrets.yaml"
$failures = New-Object Collections.Generic.List[String]
foreach ($file in $files) {
esphome compile $file.Name
if ($LASTEXITCODE -ne "0") {
$failures.Add($file.Name)
}
}
if ($failures -eq 0) {
Write-Output "`n`nAll devices compiled successfully"
}
else {
Write-Output "`n`nThe following devices failed to compile:"
foreach ($failure in $failures) {
Write-Output $failure
}
}
Pop-Location