Created
June 8, 2024 10:07
-
-
Save zxdavb/36c26fb201700fe2e60346332e7d0145 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# The directory to scan | |
set dir "homeassistant/components" | |
# Find all subdirectories | |
for subdir in (find $dir -type d) | |
# Check if the directory contains any Python files | |
if find $subdir -name "*.py" | read >/dev/null | |
# Check if any Python file in the directory imports DataUpdateCoordinator | |
if grep -l "DataUpdateCoordinator" $subdir/__init__.py >/dev/null | |
# Check if no Python file in the directory imports ConfigFlow | |
if not grep -rl "ConfigFlow" $subdir >/dev/null; and not grep -rl "ConfigEntry" $subdir >/dev/null | |
echo $subdir | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment