Add support for empty values in the persistEnv method
This commit is contained in:
@@ -389,11 +389,12 @@ class InstallCommand extends Command
|
|||||||
$envKey = strtoupper($key);
|
$envKey = strtoupper($key);
|
||||||
$envValue = env($envKey) ?: 'null';
|
$envValue = env($envKey) ?: 'null';
|
||||||
|
|
||||||
file_put_contents($path, str_replace(
|
$envFileContents = file_get_contents($path);
|
||||||
"{$envKey}={$envValue}",
|
$envFileContents = str_replace("{$envKey}={$envValue}", "{$envKey}={$value}", $envFileContents, $count);
|
||||||
"{$envKey}={$value}",
|
if ($count < 1 && $envValue === 'null') {
|
||||||
file_get_contents($path)
|
$envFileContents = str_replace("{$envKey}=", "{$envKey}={$value}", $envFileContents);
|
||||||
));
|
}
|
||||||
|
file_put_contents($path, $envFileContents);
|
||||||
} catch (InvalidPathException $e) {
|
} catch (InvalidPathException $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user