Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Add support for .yaml #104
Browse files Browse the repository at this point in the history
  • Loading branch information
francescou committed Jan 12, 2018
1 parent 6bb72f2 commit e7249dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/find_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def find_yml_files(path):
"""
matches = {}
for root, _, filenames in os.walk(path, followlinks=True):
for _ in fnmatch.filter(filenames, 'docker-compose.yml'):
for _ in list(set().union(fnmatch.filter(filenames, 'docker-compose.yml'), fnmatch.filter(filenames, 'docker-compose.yaml'))):

This comment has been minimized.

Copy link
@droogmic

droogmic Jan 12, 2018

I think the outer list() is unnecessary given it just needs a collection to iterate through, e.g. a set.

key = root.split('/')[-1]
matches[key] = os.path.join(os.getcwd(), root)
return matches
Expand Down
4 changes: 2 additions & 2 deletions scripts/manage_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
docker compose project management
"""

from os import rename, makedirs
from os import rename, makedirs, path
from time import time

def manage(directory, yml, is_update):
"""
create or update docker compose project
"""

file_path = directory + "/docker-compose.yml"
file_path = directory + "/docker-compose.yml" if path.exists(directory + "/docker-compose.yml") else "/docker-compose.yaml"

if is_update:
rename(file_path, file_path + "." + str(int(round(time()))))
Expand Down

0 comments on commit e7249dc

Please sign in to comment.