Skip to content

Commit c270f82

Browse files
Merge pull request #53 from aws-samples/fix/issue-52
Fix/issue 52
2 parents 2407e77 + fb48b5b commit c270f82

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ repos:
7373
# - id: flake8
7474
# args: ['--ignore=E501']
7575
- repo: https://github.com/jendrikseipp/vulture
76-
rev: 'v2.7' # or any later Vulture version
76+
rev: 'v2.9.1' # or any later Vulture version
7777
hooks:
7878
- id: vulture
7979
args: ['scan.py', ]

scan.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
from datetime import datetime
1414
import requests
1515

16-
# Define the timestamp as a string, which will be the same throughout the execution of the script.
17-
timestamp = datetime.now().isoformat(timespec="minutes")
16+
# accomodate windows and unix path
17+
timestamp = datetime.now().isoformat(timespec="minutes").replace(":", "-")
1818

1919

2020
def get_json_from_url(url):
@@ -314,7 +314,10 @@ def main(
314314
results.extend(region_results)
315315
for service_result in region_results:
316316
directory = os.path.join(output_dir, timestamp, region)
317-
os.makedirs(directory, exist_ok=True)
317+
try:
318+
os.makedirs(directory, exist_ok=True)
319+
except NotADirectoryError:
320+
log.error("Invalid directory name: %s", directory)
318321
with open(
319322
os.path.join(directory, f"{service_result['service']}.json"),
320323
"w",

0 commit comments

Comments
 (0)