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

Zola panics if static directory does not exist (with compile_sass = false) #2604

Open
amtanq opened this issue Aug 9, 2024 · 1 comment
Open
Labels
bug done in pr Already done in a PR

Comments

@amtanq
Copy link
Contributor

amtanq commented Aug 9, 2024

Bug Report

Environment

OS: macOS 14.5
Zola version: 0.19.1
Processor Class: arm

Expected Behavior

If static folder is required then the error should point to this (also this should be consistent irrespective of compile_sass flag). This is not a big issue (for me), but documenting it.

Current Behavior

Zola panics if static folder does not exist and compile_sass is set to false

Step to reproduce

  • create new zola site by zola init test
  • ensure to disable sass compilation
  • remove static directory rmdir static
  • run zola serve

Stacktrace

RUST_BACKTRACE=full zola serve

Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 0 pages (0 orphan) and 0 sections
Done in 10ms.

thread 'main' panicked at src/cmd/serve.rs:507:59:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
stack backtrace:
   0:        0x102b9e304 - __mh_execute_header
   1:        0x102253b84 - __mh_execute_header
   2:        0x102b8d30c - __mh_execute_header
   3:        0x102b9e120 - __mh_execute_header
   4:        0x102b9a2d4 - __mh_execute_header
   5:        0x102b9b8d0 - __mh_execute_header
   6:        0x102b9e698 - __mh_execute_header
   7:        0x102b9e600 - __mh_execute_header
   8:        0x102b9a79c - __mh_execute_header
   9:        0x102d987fc - __mh_execute_header
  10:        0x102d98c58 - __mh_execute_header
  11:        0x1020f1008 - __mh_execute_header
  12:        0x1020fd024 - __mh_execute_header
  13:        0x1020aa8f0 - __mh_execute_header
  14:        0x102109664 - __mh_execute_header
@Keats Keats added the bug label Aug 9, 2024
@Keats
Copy link
Collaborator

Keats commented Aug 9, 2024

Ok this one is easy to fix, there's an unwrap at the line pointed in the snippet which we should handle.

@Keats Keats added the done in pr Already done in a PR label Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

2 participants