enonic / cli-enonic

GNU General Public License v3.0
41 stars 1 forks source link

`project create` command should not start linked sandbox #536

Closed sigdestad closed 4 months ago

sigdestad commented 5 months ago

Running the following command: enonic create my.first.r4xp -r starter-react4xp -s r4xptutorial -f will automatically start the linked sandbox, but it should not.

FYI: Commands like enonic (project) create -r starter-react4xp -f works fine, as these say you have to specify sandbox Running enonic (project) create also works fine, as it will ask for every step (including creating and starting sandbox)

pmi commented 5 months ago

@sigdestad Why not ? There is a reason it behaves this way:

Flag -f means default answer to all questions. And there is a question at the end of creation of a project whether you want to run it with the default answer Y. So it will break these rules if we make it behave differently here.

It tries to start it without the sandbox provided as well, but complains about it missing in the last line:

enonic create my.first.r4xp -r starter-react4xp -f
...
Sandbox distro and name must be set!
alansemenov commented 5 months ago

The question is not in how "-f" flag works. It's about that CLI should suggest to start a sandbox only if sandbox was created as a part of the command execution. If a project is linked to an existing sandbox (as with -s r4xptutorial from the example above), it should not suggest to start it because no sandbox was created.

pmi commented 5 months ago

Hmm, I thought the reason it asked was you just created a project and wanted to deploy it ? Not because you had to create a sandbox on the way 😕

pmi commented 5 months ago

Ok, I think I got it -- we only want to ask about starting sandbox after creating sandbox and nothing else ?

alansemenov commented 5 months ago

Ok, I think I got it -- we only want to ask about starting sandbox after creating sandbox and nothing else ?

Correct