From 5d43935cdedbfe7d30fcdb224557592f73b57c83 Mon Sep 17 00:00:00 2001 From: Jack Plowman <62281988+JackPlowman@users.noreply.github.com> Date: Sat, 5 Oct 2024 11:55:45 +0100 Subject: [PATCH] Add file saved debug messages --- analyser/statistics.py | 5 ++++- run.sh | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/analyser/statistics.py b/analyser/statistics.py index c375a27..9452bb0 100644 --- a/analyser/statistics.py +++ b/analyser/statistics.py @@ -9,6 +9,7 @@ from analyser.utils.repository_actions import remove_excluded_files logger: stdlib.BoundLogger = get_logger() +DEFAULT_FILE_LOCATION = "statistics/repository_statistics.json" def create_statistics() -> None: @@ -27,6 +28,7 @@ def create_statistics() -> None: list_of_repositories.append(catalogued_repository) logger.info("List of repositories", list_of_repositories=list_of_repositories) + DataFrame( [ { @@ -38,7 +40,8 @@ def create_statistics() -> None: } for repository in list_of_repositories ] - ).to_json("statistics/repository_statistics.json", orient="records") + ).to_json(DEFAULT_FILE_LOCATION, orient="records") + logger.info("Saved statistics to file", file_location=DEFAULT_FILE_LOCATION) def create_repository_statistics(repository_name: str, path_to_repo: str) -> CataloguedRepository: diff --git a/run.sh b/run.sh index 684ea1f..f0519ae 100755 --- a/run.sh +++ b/run.sh @@ -13,4 +13,5 @@ python -m analyser if [ "$CI" = "true" ]; then # if running in GitHub Actions, copy the output to the output directory cp statistics/repository_statistics.json github/workspace/repository_statistics.json + echo "Copied statistics to github/workspace" fi