This change adds a function to utils.py that checks whether a provided path leads to a directory or just a file
The aforementioned function is then added to the top of app.py to check whether save_dir and/or save_dir_native are valid paths
I want to add this change because this will save resources in case you input a bad path. Otherwise the script proceeds to make expensive API calls to EUMETSAT etc. to then fail at the very end when it tries pushing files to the provided save_dir and/or save_dir_native paths.
This has not been put on the issues page
How Has This Been Tested?
The following list shows the 3 save_dir paths that been given as arguments and their results after this PR's changes:
A save_dir path that leads to a directory, satip continues executing
A save_dir path that leads to a file, satip logs the error and halts execution
A save_dir path that doesn't lead to a file or directory, satip logs the error and halts execution
…ries
Pull Request
Description
This change adds a function to utils.py that checks whether a provided path leads to a directory or just a file
The aforementioned function is then added to the top of app.py to check whether save_dir and/or save_dir_native are valid paths
I want to add this change because this will save resources in case you input a bad path. Otherwise the script proceeds to make expensive API calls to EUMETSAT etc. to then fail at the very end when it tries pushing files to the provided save_dir and/or save_dir_native paths.
This has not been put on the issues page
How Has This Been Tested?
The following list shows the 3 save_dir paths that been given as arguments and their results after this PR's changes:
Checklist: