Merge pull request #1026 from micahflee/992_website_misc

Validate filenames in CLI for website mode
This commit is contained in:
Micah Lee 2019-09-15 17:56:36 -07:00 committed by GitHub
commit e35255861f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,13 +88,14 @@ def main(cwd=None):
else: else:
mode = 'share' mode = 'share'
# Make sure filenames given if not using receiver mode # In share an website mode, you must supply a list of filenames
if mode == 'share' and len(filenames) == 0: if mode == 'share' or mode == 'website':
parser.print_help() # Make sure filenames given if not using receiver mode
sys.exit() if len(filenames) == 0:
parser.print_help()
sys.exit()
# Validate filenames # Validate filenames
if mode == 'share':
valid = True valid = True
for filename in filenames: for filename in filenames:
if not os.path.isfile(filename) and not os.path.isdir(filename): if not os.path.isfile(filename) and not os.path.isdir(filename):