fix
This commit is contained in:
parent
996d201575
commit
d135a4ec75
|
@ -44,7 +44,7 @@ class PutEnv {
|
|||
foreach ($this->content as $l => $line) {
|
||||
if (strlen($line) < 1) {
|
||||
if ($lineWasEmpty) {
|
||||
unset ($this->content[$l]);
|
||||
$this->content[$l] = null;
|
||||
} else {
|
||||
$lineWasEmpty = true;
|
||||
}
|
||||
|
@ -66,6 +66,13 @@ class PutEnv {
|
|||
} else if ($changed > 1) {
|
||||
echo "Key $key changed $changed times\n";
|
||||
}
|
||||
$content = $this->content;
|
||||
$this->content = [];
|
||||
foreach ($content as $line) {
|
||||
if ($line !== null) {
|
||||
$this->content[] = $line;
|
||||
}
|
||||
}
|
||||
$content = implode("\n", $this->content);
|
||||
file_put_contents($this->file, $content);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue