mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-29 02:30:05 +02:00
Added possibility to override config from cli
This commit is contained in:
parent
f8b5cb2f59
commit
0eebe8bea1
|
@ -98,6 +98,8 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
|
|||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->getConfig()->overrideConfigWithCLIArguments();
|
||||
|
||||
// Check if Environment is not Locked
|
||||
$lockFile = '.mage/' . $this->getConfig()->getEnvironment() . '.lock';
|
||||
if (file_exists($lockFile)) {
|
||||
|
|
|
@ -487,4 +487,14 @@ class Config
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
public function overrideConfigWithCLIArguments()
|
||||
{
|
||||
$filter = function(&$item, $key) {
|
||||
if (in_array($key, array_keys($this->getParameters()))) {
|
||||
$item = $this->getParameter($key);
|
||||
}
|
||||
};
|
||||
|
||||
array_walk_recursive($this->config, $filter);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue