In order to run a command like yaml:diff, Drupal console requires me to first install Drupal. As a developer, I would expect to be able to compare and modify yaml files without the involvement of Drupal core. Is this really a requirement?
@grasmash This will be fixed. We are moving more command to the DrupalConsole Core project.
@jmolivas any update on this?
I'd be willing to submit a PR to effect this change if you can provide some general instructions.
@grasmash @sarahjean we are looking at splitting the repo using the mono-repo technique thats why we are holding this, to avoid duplicating work.
@jmolivas - I've encountered a couple issues using Drupal Console with BLT in the past week, and I was wondering how progress is coming on splitting up the repo, and where I/we could focus efforts to try to get this working (BLT reallllly needs to update the Console version鈥攊t's still on beta5, I think).
@geerlingguy @grasmash our plans are:
We are going to use this project for the split part => https://github.com/splitsh/lite
@grasmash @geerlingguy I am currently working on fixing this issue.
@grasmash @geerlingguy done yaml:* commands relocated to console-core
https://github.com/hechoendrupal/drupal-console-core/tree/master/src/Command/Yaml
This will be included on the next release.
@jmolivas Yeeesssss!
@jmolivas It looks like the issue persists, though it is slightly altered. Drupal doesn't need to be installed, but a full copy of core is required.
./vendor/bin/drupal yaml:update:value blt/project.yml project.local.hostname '127.0.0.1:8888'
DrupalConsole must be executed within a Drupal Site.
Is it possible to execute this console command outside the context of a Drupal site?
Furthermore, if I do download a full copy of Drupal core and I attempt to use this command from a directory above the docroot, console is unable to locate the yaml file:
./vendor/bin/drupal yaml:update:value blt/project.yml project.local.hostname '127.0.0.1:8888'
YAML file "blt/project.yml" is empty or doesn't exist.
TypeError: Argument 1 passed to Drupal\Console\Core\Utils\NestedArray::setValue() must be of the type array, null given, called in /Users/matthew.grasmick/Sites/acquia/blted8/vendor/drupal/console-core/src/Command/Yaml/UpdateValueCommand.php on line 90 in Drupal\Console\Core\Utils\NestedArray::setValue() (line 155 of /Users/matthew.grasmick/Sites/acquia/blted8/vendor/drupal/console-core/src/Utils/NestedArray.php)
Would it make sense to completely remove the yaml commands from Drupal console and create a new standalone tool that provides yaml file manipulation via a Symfony command?
@grasmash that make total sense we should extract that functionality as separated commands.
Can we have a call I like to have this fixed.
@jmolivas Sure, I'd be happy to chat. I'll join your Gitter channel too.
I've created this project in the meantime: https://github.com/grasmash/yaml-cli. You're welcome to collaborate.
It doesn't really use any code from Drupal Console, which is intentional. This seems useful as a standalone, lightweight utility.
I can introduce the other commands like update:key, unset:key, etc.
This issue is not longer present in the current version 1.8.0
Most helpful comment
@grasmash @geerlingguy done
yaml:*commands relocated to console-corehttps://github.com/hechoendrupal/drupal-console-core/tree/master/src/Command/Yaml
This will be included on the next release.