Skip to content
Snippets Groups Projects
Verified Commit 8a5696fb authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

cli.client: Let click check for filepath existence

parent a4c3f018
No related branches found
Tags v0.0.70
No related merge requests found
......@@ -178,9 +178,6 @@ def client_command_parse_input(
archive_deposit = False
metadata_deposit = False
if archive and not os.path.exists(archive):
raise InputError('Software Archive %s must exist!' % archive)
if not slug: # generate one as this is mandatory
slug = generate_slug()
......@@ -199,10 +196,6 @@ def client_command_parse_input(
"Metadata deposit must be provided for metadata "
"deposit (either a filepath or --name and --author)")
if metadata and not os.path.exists(metadata):
raise InputError('Software Archive metadata %s must exist!' % (
metadata, ))
if not archive and not metadata:
raise InputError(
'Please provide an actionable command. See --help for more '
......@@ -274,9 +267,9 @@ def deposit_update(config, logger):
help="(Mandatory) User's name")
@click.option('--password', required=1,
help="(Mandatory) User's associated password")
@click.option('--archive',
@click.option('--archive', type=click.Path(exists=True),
help='(Optional) Software archive to deposit')
@click.option('--metadata',
@click.option('--metadata', type=click.Path(exists=True),
help="(Optional) Path to xml metadata file. If not provided, this will use a file named <archive>.metadata.xml") # noqa
@click.option('--archive-deposit/--no-archive-deposit', default=False,
help='(Optional) Software archive only deposit')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment