mirror of
https://github.com/esphome/esphome.git
synced 2025-10-08 04:43:46 +01:00
Allow both files and directories to be passed to update-all (#10575)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
@@ -272,12 +272,15 @@ class OrderedDict(collections.OrderedDict):
|
||||
return dict(self).__repr__()
|
||||
|
||||
|
||||
def list_yaml_files(folders: list[str]) -> list[str]:
|
||||
files = filter_yaml_files(
|
||||
[os.path.join(folder, p) for folder in folders for p in os.listdir(folder)]
|
||||
)
|
||||
files.sort()
|
||||
return files
|
||||
def list_yaml_files(configs: list[str]) -> list[str]:
|
||||
files: list[str] = []
|
||||
for config in configs:
|
||||
if os.path.isfile(config):
|
||||
files.append(config)
|
||||
else:
|
||||
files.extend(os.path.join(config, p) for p in os.listdir(config))
|
||||
files = filter_yaml_files(files)
|
||||
return sorted(files)
|
||||
|
||||
|
||||
def filter_yaml_files(files: list[str]) -> list[str]:
|
||||
|
Reference in New Issue
Block a user