diff --git a/lona/command_line/collect_static.py b/lona/command_line/collect_static.py index 0e654ad3..a643dd80 100644 --- a/lona/command_line/collect_static.py +++ b/lona/command_line/collect_static.py @@ -39,12 +39,22 @@ def _mkdir(path): pass def _cp(source, destination): - _print('cp {} {}'.format(source, destination)) + source_is_dir = os.path.isdir(source) + + if source_is_dir: + _print('cp -r {} {}'.format(source, destination)) + + else: + _print('cp {} {}'.format(source, destination)) if args.dry_run: return - shutil.copy(source, destination) + if source_is_dir: + shutil.copytree(source, destination) + + else: + shutil.copy(source, destination) # setup logging setup_logging(args)