Skip to content

Commit d068d05

Browse files
committed
add MAILCARRIER_SOCIAL_AUTH_DRIVER also for custom drivers
1 parent 1f7a64f commit d068d05

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Commands/SocialCommand.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,22 @@ protected function addServicesConfig(): void
9191
*/
9292
protected function addEnvs(string $envFile): void
9393
{
94-
if ($this->chosenDriver === self::DRIVER_OTHER) {
94+
// Do not add the entry if already exists
95+
if (str_contains($envFile, 'MAILCARRIER_SOCIAL_AUTH_DRIVER=')) {
9596
return;
9697
}
9798

9899
$envPath = getcwd() . '/' . $envFile;
99100
$envFile = file_get_contents($envPath);
100101

101-
// Do not add the entry if already exists
102-
if (str_contains($envFile, 'MAILCARRIER_SOCIAL_AUTH_DRIVER=')) {
103-
return;
102+
if ($this->chosenDriver === self::DRIVER_OTHER) {
103+
$envFile .= 'MAILCARRIER_SOCIAL_AUTH_DRIVER=' . PHP_EOL;
104+
} else {
105+
$envFile .= 'MAILCARRIER_SOCIAL_AUTH_DRIVER=' . strtolower($this->chosenDriver) .
106+
PHP_EOL .
107+
$this->buildEnvs();
104108
}
105109

106-
$envFile .= 'MAILCARRIER_SOCIAL_AUTH_DRIVER=' . strtolower($this->chosenDriver) .
107-
PHP_EOL .
108-
$this->buildEnvs();
109-
110110
file_put_contents($envPath, $envFile);
111111
}
112112

0 commit comments

Comments
 (0)