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

Installing Drupal is required for running YAML commands #2905

Closed
grasmash opened this issue Nov 9, 2016 · 15 comments
Closed

Installing Drupal is required for running YAML commands #2905

grasmash opened this issue Nov 9, 2016 · 15 comments
Labels

Comments

@grasmash
Copy link
Contributor

grasmash commented Nov 9, 2016

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?

@jmolivas
Copy link
Member

@grasmash This will be fixed. We are moving more command to the DrupalConsole Core project.

@sarahjean
Copy link

@jmolivas any update on this?

@grasmash
Copy link
Contributor Author

grasmash commented Dec 5, 2016

I'd be willing to submit a PR to effect this change if you can provide some general instructions.

@jmolivas
Copy link
Member

jmolivas commented Dec 5, 2016

@grasmash @sarahjean we are looking at splitting the repo using the mono-repo technique thats why we are holding this, to avoid duplicating work.

@geerlingguy
Copy link

@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—it's still on beta5, I think).

@jmolivas
Copy link
Member

jmolivas commented Dec 22, 2016

@geerlingguy @grasmash our plans are:

  • Tag a new RC-12 this week (today or tomorrow)
  • Split the project will start next immediately and should have completed for later next week.

We are going to use this project for the split part => https://github.com/splitsh/lite

@jmolivas
Copy link
Member

@grasmash @geerlingguy I am currently working on fixing this issue.

@jmolivas
Copy link
Member

jmolivas commented Dec 29, 2016

@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.

@grasmash
Copy link
Contributor Author

@jmolivas Yeeesssss!

@grasmash
Copy link
Contributor Author

grasmash commented Jan 3, 2017

@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?

@grasmash
Copy link
Contributor Author

grasmash commented Jan 3, 2017

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)

@grasmash
Copy link
Contributor Author

grasmash commented Jan 3, 2017

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?

@jmolivas
Copy link
Member

jmolivas commented Jan 3, 2017

@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 jmolivas removed this from the 1.0.0-rc13 milestone Jan 3, 2017
@grasmash
Copy link
Contributor Author

grasmash commented Jan 3, 2017

@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.

@hjuarez20
Copy link
Contributor

This issue is not longer present in the current version 1.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants