Fixed asset rm
This commit is contained in:
parent
167fea0a2c
commit
90ffc019d2
@ -60,6 +60,9 @@ def copy_assets(site: SiteConfig) -> None:
|
||||
destination = f'{site.web_root}/{asset.removeprefix(site.build_cache).lstrip("/")}'
|
||||
|
||||
# Delete existing files.
|
||||
if os.path.isfile(destination):
|
||||
os.remove(destination)
|
||||
elif os.path.isdir(destination):
|
||||
shutil.rmtree(destination, ignore_errors=True)
|
||||
|
||||
# Copy the asset.
|
||||
@ -74,6 +77,9 @@ def copy_assets(site: SiteConfig) -> None:
|
||||
# level of the filetree than the included assets, remove them.
|
||||
for asset in ignored_asset_list:
|
||||
destination = f'{site.web_root}/{asset.removeprefix(site.build_cache).lstrip("/")}'
|
||||
if os.path.isfile(destination):
|
||||
os.remove(destination)
|
||||
elif os.path.isdir(destination):
|
||||
shutil.rmtree(destination, ignore_errors=True)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user