Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
Added error message for cases when the user tries to run the update c…
Browse files Browse the repository at this point in the history
…ommand and specifies an invalid remote file name
  • Loading branch information
DavidBerdik committed May 28, 2020
1 parent 12bbfff commit 365676b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion InfiniDrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,15 @@ def update(self, file_name=None, file_path=None):
file_name = sys.argv[2]
file_path = sys.argv[3]

# Get Drive service and directory ID.
# Get Drive service.
driveConnect = driveAPI.get_service()

# Check if a remote file with the given name exists. If one does not, print an error message and return.
if not driveAPI.file_with_name_exists(driveConnect, file_name):
print('Remote file with name ' + file_name + ' does not exist.')
return

# Get directory ID.
dirId = driveAPI.get_file_id_from_name(driveConnect, file_name)

# Get a list of the fragments that currently make up the file. If this is a new upload, it should come back empty.
Expand Down

0 comments on commit 365676b

Please sign in to comment.