getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.12k stars 925 forks source link

Static fails to copy file because it already exists in template #1869

Open jvasile opened 2 years ago

jvasile commented 2 years ago

Bug Report

Environment

Debian Linux

Zola version: 0.15.3, downloaded from the github releases page

Expected Behavior

Zola copies /static/img/home-bg.jpg to /public/img/home-bg,jpg

Current Behavior

I'm trying to override an image in a theme. The theme image is in theme/zola-clean-blog/static/img. My image is in /static/img. As I understand it, zola should put my version in public/img, not the theme version. But instead it throws an error and places the template's version of the image.

Step to reproduce

$ ls themes/zola-clean-blog/static/img/home-bg.jpg themes/zola-clean-blog/static/img/home-bg.jpg $ ls static/img/home-bg.jpg static/img/home-bg.jpg $ zola build Building site... Checking all internal links with anchors. Successfully checked 0 internal link(s) with anchors. -> Creating 15 pages (0 orphan) and 2 sections Failed to build the site Error: Was not able to copy file /static/img/home-bg.jpg to /public Reason: File exists (os error 17)

jvasile commented 2 years ago

Update: I removed the /theme/zola-clean-blog/static/img/home-bg.jpg, deleted /public/* and rebuilt. It works because the file doesn't already exist. But, zola serve gives me the "file exists" error.

Keats commented 2 years ago

Hm weird I can't reproduce on OSX. copy should not error if the destination already exists on any OS 🤔