Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lume -s, Fail to copy file to where the path once was a directory #626

Open
iacore opened this issue Jun 27, 2024 · 2 comments
Open

lume -s, Fail to copy file to where the path once was a directory #626

iacore opened this issue Jun 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@iacore
Copy link
Contributor

iacore commented Jun 27, 2024

Version

about the latest

Platform

Linux

What steps will reproduce the bug?

  1. site.copy('public')
deno task serve &
# wait for server to launch
cd public/
mkdir b.md
touch b.md/b.md
rm -r b.md; touch b.md

How often does it reproduce? Is there a required condition?

100% methinks

What is the expected behavior?

There should be no error.

What do you see instead?

ERROR Failed to copy file: /b.md/b.md: Not a directory (os error 20): readfile '/home/user/__site__/public/b.md/b.md'

Additional information

workaround: run deno task serve again.

@iacore iacore added the bug Something isn't working label Jun 27, 2024
@oscarotero
Copy link
Member

oscarotero commented Jun 27, 2024

Do you mean this error should be catched and showed in the terminal but without exit?

@iacore
Copy link
Contributor Author

iacore commented Jun 28, 2024

Do you mean this error should be cached and showed in the terminal but without exit?

ohhh sorry i forgot to fill in the field; it should not be an user-facing error.

let me explain why the error happens

  1. b.md/b.md is created
  2. b.md/b.md is deleted, but b.md/ isn't deleted
  3. b.md is created

proper behavior:
when Lume sees empty folder it should overwrite it

this may mess with site.copy('empty_directory'); not sure who would want to put an empty directory in the output though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants