From 876fc3ba8165b5d8e2e47c6ec57001e7270555ee Mon Sep 17 00:00:00 2001 From: Chris Nussbaum Date: Fri, 17 Sep 2021 11:19:49 -0500 Subject: [PATCH] Compile all devices script (#23) --- scripts/compile_all_devices.ps1 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/compile_all_devices.ps1 diff --git a/scripts/compile_all_devices.ps1 b/scripts/compile_all_devices.ps1 new file mode 100644 index 0000000..c6dd980 --- /dev/null +++ b/scripts/compile_all_devices.ps1 @@ -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 \ No newline at end of file