diff options
author | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2022-03-01 13:42:18 +0000 |
---|---|---|
committer | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2022-03-01 13:45:39 +0000 |
commit | 6b9adad2bde07764bc0b28ff0a43c72306d5e139 (patch) | |
tree | 11015516426615cf6c558e45a571a9852719bb95 /scripts/py/check_update_resources_downloaded.py | |
parent | acc6b85c0086ff4a37d2108ec9edfb8faf6f43e6 (diff) | |
download | ml-embedded-evaluation-kit-6b9adad2bde07764bc0b28ff0a43c72306d5e139.tar.gz |
MLECO-2881: Minor improvements for downloaded resources
Check could have been bypassed if the script path provided as
an argument was incorrect. Also, a minor update in the CMake
function to fix the path.
Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Change-Id: Id3cd4027843783e3ed8700eac503e7ba3f09ad04
Diffstat (limited to 'scripts/py/check_update_resources_downloaded.py')
-rw-r--r-- | scripts/py/check_update_resources_downloaded.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/py/check_update_resources_downloaded.py b/scripts/py/check_update_resources_downloaded.py index 6408f14..c016665 100644 --- a/scripts/py/check_update_resources_downloaded.py +++ b/scripts/py/check_update_resources_downloaded.py @@ -60,13 +60,21 @@ def check_update_resources_downloaded( if __name__ == "__main__": parser = ArgumentParser() parser.add_argument( - "--resource_downloaded_dir", help="Resources downloaded directory.", type=str - ) + "--resource_downloaded_dir", + help="Resources downloaded directory.", + type=str, + required=True) parser.add_argument( - "--setup_script_path", help="Path to set_up_default_resources.py.", type=str - ) + "--setup_script_path", + help="Path to set_up_default_resources.py.", + type=str, + required=True) args = parser.parse_args() + # Check validity of script path + if not os.path.isfile(args.setup_script_path): + raise ValueError(f'Invalid script path: {args.setup_script_path}') + # Check if the repo root directory is a git repository root_file_dir = os.path.dirname(os.path.abspath(args.setup_script_path)) is_git_repo = os.path.exists(os.path.join(root_file_dir, ".git")) |