Skip to content

Commit

Permalink
Fix shutil rmtree exception when folder does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
triole committed Mar 30, 2020
1 parent 8cead36 commit 070b534
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rdmo/core/management/commands/download_vendor_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class Command(BaseCommand):
def handle(self, *args, **options):
# remove old vendor files
vendor_dir = os.path.join(settings.BASE_DIR, 'vendor/')
shutil.rmtree(vendor_dir)
try:
shutil.rmtree(vendor_dir)
except FileNotFoundError:
pass

for key, vendor_conf in settings.VENDOR.items():
for file_type in ['js', 'css', 'img', 'font']:
Expand Down

0 comments on commit 070b534

Please sign in to comment.