Skip to content

Commit 4a7fdae

Browse files
committed
Update composer; fix environment setting
1 parent 96592e2 commit 4a7fdae

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

app/Console/Commands/UpdateEnvironment.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ public function handle()
8484

8585
$this->line('Writing new environment configuration to file.');
8686
foreach ($variables as $key => $value) {
87-
$regex = '/^' . $key . '=(.*)$/m';
88-
$replace = $key . '=' . $value;
89-
$envContents = preg_replace($regex, $replace, $envContents);
87+
$newValue = $key . '=' . $value;
88+
if (preg_match_all('/^' . $key . '=(.*)$/m', $envContents) < 1) {
89+
$envContents = $envContents . "\n" . $newValue;
90+
} else {
91+
$envContents = preg_replace('/^' . $key . '=(.*)$/m', $newValue, $envContents);
92+
}
9093
$bar->advance();
9194
}
9295

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,17 @@
7474
"sed -i.bak 's/homestead.app/pterodactyl.local/g' Homestead.yaml",
7575
"rm Homestead.yaml.bak",
7676
"php artisan key:generate",
77-
"php artisan pterodactyl:env"
77+
"php artisan pterodactyl:env",
78+
"php artisan migrate",
79+
"php artisan pterodactyl:user"
7880
],
7981
"setup": [
8082
"composer install --ansi --no-dev",
8183
"php -r \"copy('.env.example', '.env');\"",
8284
"php artisan key:generate",
83-
"php artisan pterodactyl:env"
85+
"php artisan pterodactyl:env",
86+
"php artisan migrate",
87+
"php artisan pterodactyl:user"
8488
]
8589
},
8690
"config": {

0 commit comments

Comments
 (0)