Skip to content

Commit

Permalink
command line: collect-static: fix wrong usage of shutil.copy
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Scherf <[email protected]>
  • Loading branch information
fscherf committed Aug 12, 2021
1 parent 1fe7700 commit f5cf300
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lona/command_line/collect_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f5cf300

Please sign in to comment.