Skip to content

Commit 880ea7f

Browse files
authored
Merge pull request #16 from chapeupreto/use-same-output-as-seen-in-the-documentation
Output the old value of the environment key that was updated
2 parents 76eddb2 + 63fe2fa commit 880ea7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/EnvironmentSetCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public function handle(): void
5959
if ($isNewVariableSet) {
6060
$this->info("A new environment variable with key '{$key}' has been set to '{$value}'");
6161
} else {
62-
$this->info("Environment variable with key '{$key}' has been updated to '{$value}'");
62+
[$_, $oldValue] = explode('=', $this->readKeyValuePair($content, $key), 2);
63+
$this->info("Environment variable with key '{$key}' has been changed from '{$oldValue}' to '{$value}'");
6364
}
6465

6566
$this->writeFile($envFilePath, $newEnvFileContent);

0 commit comments

Comments
 (0)