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

zine build fails if dest/static directory not exists #32

Closed
DingDean opened this issue Apr 2, 2022 · 2 comments
Closed

zine build fails if dest/static directory not exists #32

DingDean opened this issue Apr 2, 2022 · 2 comments

Comments

@DingDean
Copy link
Contributor

DingDean commented Apr 2, 2022

Which version am I using?

zine 0.3.0 on Mac mini (M1, 2020)

What's the problem?

Zine fails to build a newly-generated project, reporting a panic:
Error: No such file or directory (os error 2)

How to reproduce?

  1. install zine 0.3.0
  2. zine new testproject
  3. cd testproject
  4. zine build
    The build should fail by now.

What might cause the issue?

After digging around in the source code, I believe the problem results from include_dir crate.

In 0.3.0, Zine copies the builtin static files into output directory's static folder by using include_dir. When include_dir extracting a file, it simply uses fs::write(TAEGET_PATH), which will panic if TARGET_PATH includes non-existence directory.

Because testproject/build/static directory does not exists when include_dir tries to extract zine's buildin static file, it simply panics.

In version 0.2.1, zine would create the output static directory first before copying static files, so the problem did not exist.
截屏2022-04-02 下午9 40 03

If we create mkdir testproject/build/static manually, then zine build successfully.

@Folyd
Copy link
Member

Folyd commented Apr 2, 2022

You are right, hugely thanks for the feedback. Do you mind submitting a PR? Thanks.

@Folyd
Copy link
Member

Folyd commented Apr 3, 2022

Fixed via #33.

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

No branches or pull requests

2 participants