lando / cli

The cli part of Lando
https://docs.lando.dev/cli
GNU General Public License v3.0
30 stars 33 forks source link

Suggestion: lando init creates dir or offers to #255

Open emile-hj opened 10 months ago

emile-hj commented 10 months ago

Hi there, I have a suggestion for the CLI functionality that could potentially be considered.

I know that others possibly use the lando init command in a different way to me, but I only using Lando to work on Drupal sites hosted on Pantheon. I frequently use:

lando init --source pantheon

to clone down an existing site and start working on it. The issue I often have is that I have to:

mkdir siteName
cd siteName
lando init --source pantheon
choose siteName

because running the init command does not create a directory. This is different to how a lot of software works and I often forget to create the directory. I end up doing:

cd sites
lando init--source pantheon

expecting it to make siteName inside sites, but instead, I clone the site directly into the sites folder.

Would it be worth considering changing this, or the command offering the option to create a site directory?

reynoldsalec commented 6 months ago

@emile-hj you're a mindreader: this has actively been discussed as the behavior of the V4 CLI. I'm going to move this over to lando/cli since I think that will be more appropriate and put a V4 tag on it so we don't "forget"

AaronFeledy commented 5 months ago

It always feels like a clunky process to me as well, prone to errors such as running init and generating the landofile in the parent directory.

That said, "init" is a command that's common to lots of tools and those tools usually use init to generate a config in the current directory. So it may be unexpected behavior to some if that's not what it does. I do think it makes sense though that recipes that walk you through the process of cloning a repo give you the option of specifying a new directory.