I've been looking at gutenberg and just tried to create one, and my first two attempts were:
gutenberg initgutenberg init .I'm not entirely set on the former working, but I feel that the latter should, which means changing the check to only allow directories that don't exist, to also allow directories that are empty.
I'm willing to implement this, but I've got interface questions:
gutenberg init initialize the current directory?First bullet point is definitely a no.
Second one I'm not really convinced.
Trying to run gutenberg init I get:
~/Code/gutenberg(branch:next) » gutenberg init vincent@arch
error: The following required arguments were not provided:
<name>
USAGE:
gutenberg init <name>
. is not a name so that would introduce 2 meanings for the argument to init: a name or current dir. Also, as you mention, it's not really obvious what should be done if the directory is not empty.
I would not change anything for now but I'll leave the issue open for discussion.
I just started with zola and it was the first issue I ran into. It's surprising that zola init in an empty directory does not just use that directory to initialize. Both cargo init and git init behave that way.
I didn't know cargo init worked without a name. I just tried it in my random folder and sure enough it created all the files/folders, except I already had a src folder and it just added a main.rs in it.
Maybe if the name is not mentioned, add an additional prompt asking if they want to create it in the current directory?
Maybe if the name is not mentioned, add an additional prompt asking if they want to create it in the current directory?
From a UX perspective I would prefer a "don't make me think approach" by default. I expect zola init to silently create a minimal, runable example that runs with zola serve. However, I do not expect the configuration to be fully done (in particular the site URL). If I see a "config.toml" I know I will have to tweak that.
If you want to provide a prompt, I would only do it when invoked from a folder that has "more than the usual suspects inside":
I'm ok with the two bullet points!
Anyone interested in implementing that?
Just ran into this too — I had the same expectation from zola init when trying to convert an existing purely HTML/CSS site into a templated one.
Most helpful comment
I just started with zola and it was the first issue I ran into. It's surprising that
zola initin an empty directory does not just use that directory to initialize. Bothcargo initandgit initbehave that way.