Fix --save-location error in decrypt command

When the --save-location flag is used it attempts to keep the name
of the file being decrypted, and saving it to a desired location.
Previously this would cause
TypeError: join() argument must be str or bytes, not 'tuple'

This is resolved by grabbing the correct value from the os.path.split
command.

Change-Id: I9344bd07f5f8d03b50ac9fc004b79fefb024bbd6
This commit is contained in:
Hughes, Alexander (ah8742) 2019-05-28 13:52:36 -05:00
parent 2fa6a1a7bd
commit d0584e8c20
1 changed files with 1 additions and 1 deletions

View File

@ -714,7 +714,7 @@ def decrypt(*, path, save_location, overwrite, site_name):
click.echo(value)
else:
for key, value in decrypted.items():
file_name = os.path.split(key)
file_name = os.path.split(key)[1]
file_save_location = os.path.join(save_location, file_name)
files.write(file_save_location, value)
os.chmod(file_save_location, 0o600)