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

fix: zola panic if no static dir #2608

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

amtanq
Copy link
Contributor

@amtanq amtanq commented Aug 10, 2024

Fixes: #2604

Root Cause:

  • Application panicked at this code std::fs::canonicalize(&output_path).unwrap() when there is no static directory and compile_sass is set to false
  • Reason for this is output_path (which in default case is public) does not get created
    • Folder gets created when there is a static folder or we have compile_sass set
  • Added create_directory code to create the directory if it does not exist before canonicalize

Alternate fix

Handle unwrap and show an error

Copy link
Collaborator

@Keats Keats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely sure why it's causing an issue because of the static folder but lgtm

@Keats Keats merged commit 0ce8936 into getzola:next Aug 11, 2024
5 checks passed
reujab pushed a commit to reujab/zola that referenced this pull request Aug 14, 2024
Keats pushed a commit that referenced this pull request Aug 15, 2024
berdandy pushed a commit to berdandy/azola that referenced this pull request Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants