diff --git a/main.py b/main.py index 11f3853..65d1951 100755 --- a/main.py +++ b/main.py @@ -13,9 +13,10 @@ def upload(path, index): - with open(path) as f: - records = json.load(f) - index.save_objects(records, {'autoGenerateObjectIDIfNotExist': True}) + if os.path.isfile(path): + with open(path) as f: + records = json.load(f) + index.save_objects(records, {'autoGenerateObjectIDIfNotExist': True}) upload("{}/{}/{}".format(github_workspace, index_file_directory, index_file_name), client.init_index(index_name))