scripts: check if dl directory exist in dl_cleanup script
authorAnsuel Smith <ansuelsmth@gmail.com>
Mon, 5 Jul 2021 22:59:40 +0000 (00:59 +0200)
committerPaul Spooren <mail@aparcar.org>
Tue, 6 Jul 2021 00:15:58 +0000 (14:15 -1000)
Check if the provided dl directory exist and return on error.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
scripts/dl_cleanup.py

index d086761dc71a3b5dfd30140071673f9f3cde411b..1acb0495827b5ff05c4a982a528dc7aa5bd6a59e 100755 (executable)
@@ -169,6 +169,11 @@ def main(argv):
                usage()
                return 1
        directory = args[0]
+
+       if not os.path.exists(directory):
+               print("Can't find dl path", directory)
+               return 1
+
        for (o, v) in opts:
                if o in ("-h", "--help"):
                        usage()