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 init fails in existing empty directory #814

Closed
demurgos opened this issue Oct 7, 2019 · 12 comments
Closed

zola init fails in existing empty directory #814

demurgos opened this issue Oct 7, 2019 · 12 comments
Labels
bug done in pr Already done in a PR

Comments

@demurgos
Copy link

demurgos commented Oct 7, 2019

Bug Report

Environment

Zola version: Github master branch
OS: Linux

Expected Behavior

Tell us what should have happened.

Running zola init in an empty directory should initialize the directory.

Current Behavior

Tell us what happens instead of the expected behavior. If you are seeing an
error, please include the full error message and stack trace. You can get the
stacktrace of a panic by adding RUST_BACKTRACE=1 when running a zola command.

Example run:

$ RUST_BACKTRACE=1 ../zola/target/debug/zola init
Welcome to Zola!
Please answer a few questions to get started quickly.
Any choices made can be changed by modifying the `config.toml` file later.
> What is the URL of your site? (https://example.com): 
> Do you want to enable Sass compilation? [Y/n]: 
> Do you want to enable syntax highlighting? [y/N]: 
> Do you want to build a search index of the content? [y/N]: 
Failed to create the project
Error: File exists (os error 17)

As you see, the initialization fails with a "File exists" error. The error message could be improved to mention which file exists: it took some digging in the issues to figure out why it failed. (Running zola init mydir works, it's initializing the current empty dir that fails).

Step to reproduce

Please provide the steps to reproduce the issue.
If the issue is hard to reproduce, please provide a sample repository or sample
that triggers the bug.

Create an empty directory, go inside and run zola init.

Related issues

@Keats Keats added the bug label Oct 7, 2019
@Keats
Copy link
Collaborator

Keats commented Oct 7, 2019

I should have tried that before releasing 🤦‍♂
In theory a very simple bugfix if anyone wants to try

@Keats Keats added the done in pr Already done in a PR label Oct 28, 2019
@Keats
Copy link
Collaborator

Keats commented Oct 28, 2019

@riginding fixed it in the next branch 🎊

@Jumanjii
Copy link

Awesome!
@Keats Do you know when will be the next release for newcomers to not meet this issue when launching Zola for the first time? 😃

@Keats
Copy link
Collaborator

Keats commented Nov 30, 2019 via email

@ebkalderon
Copy link

@Keats Would it be possible to have this fix released sooner? Without it, the out-of-the-box user experience for new users looking to initialize a new Zola project inside an existing Git repo is very poor. Thanks for all the effort in creating and maintaining this project!

@Keats
Copy link
Collaborator

Keats commented Jan 19, 2020

There's a WIP feature in the next branch (the slugification), as soon as it gets finished it will be released. The basic version is already in there, it just needs to be polished

@ebkalderon
Copy link

@Keats Awesome! Can't wait to try it out. Once the initial project directory is created, the rest of the user experience is much better. I'll gladly try out that branch and see how the slugification feature is faring.

@sbrl
Copy link

sbrl commented Feb 9, 2020

I'm getting this error too compiling from master. I guess it hasn't been merged in from next yet?

@Keats
Copy link
Collaborator

Keats commented Feb 10, 2020

It has been merged in next, not released yet. Try building the next branch

@sbrl
Copy link

sbrl commented Feb 10, 2020

I see. Thanks @Keats!

I did manage to get it working by guessing the CLI argument structure (documentation? what documentation?), but haven't really found Zola to be suitable for my use-case - hence I'm currently exploring alternatives.

For reference I want to build a simple static site for an open-source project of mine.

@Keats
Copy link
Collaborator

Keats commented Feb 10, 2020

I did manage to get it working by guessing the CLI argument structure (documentation? what documentation?)

Is https://www.getzola.org/documentation/getting-started/cli-usage/#init not detailed enough? There are some improvements already in the next branch for that page: https://github.com/getzola/zola/blob/next/docs/content/documentation/getting-started/cli-usage.md

@sbrl
Copy link

sbrl commented Feb 10, 2020

Ah, I see! I must have missed that.

@Keats Keats closed this as completed Mar 13, 2020
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

5 participants