ESPHome-Devices/scripts/compile_all_devices.ps1

20 lines
551 B
PowerShell
Raw Normal View History

2021-09-29 12:07:52 +00:00
$files = Get-ChildItem $PSScriptRoot\..\devices\*.yaml -Exclude "secrets.yaml"
2021-09-17 16:19:49 +00:00
$failures = New-Object Collections.Generic.List[String]
foreach ($file in $files) {
2021-09-29 12:07:52 +00:00
$fileName = $file.Name
esphome compile $PSScriptRoot\..\devices\$fileName
2021-09-17 16:19:49 +00:00
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
}
}