Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drupal / console-core / src / Command / InitCommand.php
index d1a409e0245282a0c263671f26ab1f7fcfe8da82..9ecc6f916826b82d4c771d2559694cddbc379568 100644 (file)
@@ -102,6 +102,12 @@ class InitCommand extends Command
                 InputOption::VALUE_OPTIONAL,
                 $this->trans('commands.init.options.destination')
             )
+            ->addOption(
+                'site',
+                null,
+                InputOption::VALUE_NONE,
+                $this->trans('commands.init.options.site')
+            )
             ->addOption(
                 'override',
                 null,
@@ -122,9 +128,14 @@ class InitCommand extends Command
     protected function interact(InputInterface $input, OutputInterface $output)
     {
         $destination = $input->getOption('destination');
+        $site = $input->getOption('site');
         $autocomplete = $input->getOption('autocomplete');
         $configuration = $this->configurationManager->getConfiguration();
 
+        if ($site && $this->appRoot && $this->consoleRoot) {
+            $destination = $this->consoleRoot . '/console/';
+        }
+
         if (!$destination) {
             if ($this->appRoot && $this->consoleRoot) {
                 $destination = $this->getIo()->choice(
@@ -190,8 +201,14 @@ class InitCommand extends Command
     {
         $copiedFiles = [];
         $destination = $input->getOption('destination');
+        $site = $input->getOption('site');
         $autocomplete = $input->getOption('autocomplete');
         $override = $input->getOption('override');
+
+        if ($site && $this->appRoot && $this->consoleRoot) {
+            $destination = $this->consoleRoot . '/console/';
+        }
+
         if (!$destination) {
             $destination = $this->configurationManager->getConsoleDirectory();
         }