Closed pchg closed 1 year ago
By taking example from the message displayed by these lines (lines 350-351):
elif file_exists:
print("%s already exists" % prod)
I added another similar message, in case unzipped files exist.
There were bugs induced by these modifications: therefore I cancel this pull request, I'll make another one shortly.
When calling this script from a shell script, I bumped into some download errors, and some partially files were left as *tmp ; I wanted a way to check that the theia_download.py got executed fine, through an exit code.
Therefore I added a ret variable (for return) that I first initialised to 0 quite early (to avoid some errors in case the curl line wasn't executed) and I assigned the return code from the curl call to it. Finally, if that return code is not zero (something went wrong), I exit the program with that exit code. This way, a calling script can know that something went wrong.
Additionally, I also added a sys.exit(-1) at the very end, although the -1 may not be the best code to return. To be discussed; I just took example from the other sys.exit() calls in the program.