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
Chain register #2953
Chain register #2953
Conversation
I merged the latest changes from master to my branch. The code isn't working now, because Config.php was deleted and I don't know how to point to chain.yml |
@@ -0,0 +1,6 @@ | |||
# Chains listed here will be auto loaded by the ChainRegister. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is no longer required on this PR
$this->add($command); | ||
} | ||
|
||
$autoWireForcedCommands = $this->getConfig()->get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove from 123 to 127 those lines got relocated to drupal-console-core
@@ -107,6 +108,24 @@ private function registerCommands() | |||
$logger->writeln($this->trans('application.site.errors.settings')); | |||
} | |||
|
|||
$chainCommands = $this->getConfig()->get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove from 111 to 115 the loading commands will not be reading a config file.
I will write the implementation
Moved PR to the sponsoring company github account https://github.com/hechoendrupal/DrupalConsole/pull/2961/files |
ClassRegister
This is a proof of concept.
I would like to be able to call chain commands without having to specify --file or other arguments, because it takes too much time to write them. I would like to just type
Also, since site:new is not currently available, I would like to have it as a chain command
Say I want to put this on jenkins, I would have to do
With this prototype, I can skip the --file
Another possibility is to have a chain calling another chain.
Chain calling another chain
chain-test-child.yml
Calling this chain:
drupal chain:test:child
The interactive mode will ask you the values for project and directory, with default values 'foo' and 'bar' respectively.
The output will be:
This is a test: Project:foo Directory:bar
Main chain calling a child chain
chain-test-main.yml
Calling this chain:
drupal chain:test:main
The interactive mode will ask you the values for project, with default values 'main-project'. Directory has a fixed value in this example.
The output will be:
This is a test: Project:main-project Directory:main-dir
How to make ChainRegister find your chains
Copy your yml files to any folder
Place the chain.yml in the console folder (same location where config.yml is)
chain.yml
ps: The name of your chain will be prepended with 'chain:' automatically.