Skip to content

Instantly share code, notes, and snippets.

@zxdavb
Created June 8, 2024 10:07
Show Gist options
  • Save zxdavb/36c26fb201700fe2e60346332e7d0145 to your computer and use it in GitHub Desktop.
Save zxdavb/36c26fb201700fe2e60346332e7d0145 to your computer and use it in GitHub Desktop.
#!/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