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

Add some command line arguments to the init command #1

Open
frob opened this issue Sep 21, 2018 · 1 comment
Open

Add some command line arguments to the init command #1

frob opened this issue Sep 21, 2018 · 1 comment

Comments

@frob
Copy link

frob commented Sep 21, 2018

It would be nice if there where some command line arguments, or really just one really. I would like to be able to tell tome what profile to install a site from through the command line. This would allow this to be scriptable.

@frob
Copy link
Author

frob commented Sep 21, 2018

Probably the easiest way to do this is to reduce the $profiles array down to the cli argument, which I would assume is the machine name.

    $profiles = $this->getProfiles();
    if (!is_null($default_profile)) {
      $profile = array_reduce($a, function ($result, $element) use ($default_profile) {
        if ($element === $default_profile) {
          $result = $element;
        }
      });
    }
    else {
      $profile = $this->io()->choice('Select an installation profile', $profiles);
    }

Something like above should work.

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

1 participant