Update composer; fix environment setting
This commit is contained in:
parent
96592e2875
commit
4a7fdaedde
2 changed files with 12 additions and 5 deletions
|
@ -84,9 +84,12 @@ class UpdateEnvironment extends Command
|
|||
|
||||
$this->line('Writing new environment configuration to file.');
|
||||
foreach ($variables as $key => $value) {
|
||||
$regex = '/^' . $key . '=(.*)$/m';
|
||||
$replace = $key . '=' . $value;
|
||||
$envContents = preg_replace($regex, $replace, $envContents);
|
||||
$newValue = $key . '=' . $value;
|
||||
if (preg_match_all('/^' . $key . '=(.*)$/m', $envContents) < 1) {
|
||||
$envContents = $envContents . "\n" . $newValue;
|
||||
} else {
|
||||
$envContents = preg_replace('/^' . $key . '=(.*)$/m', $newValue, $envContents);
|
||||
}
|
||||
$bar->advance();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue