From 4a7fdaedde5183269ff0cd0791e8c5db3c225ccd Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Mon, 25 Jan 2016 20:30:50 -0500 Subject: [PATCH] Update composer; fix environment setting --- app/Console/Commands/UpdateEnvironment.php | 9 ++++++--- composer.json | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/UpdateEnvironment.php b/app/Console/Commands/UpdateEnvironment.php index e58fce5fd..9fcbfda7c 100644 --- a/app/Console/Commands/UpdateEnvironment.php +++ b/app/Console/Commands/UpdateEnvironment.php @@ -84,9 +84,12 @@ class UpdateEnvironment extends Command $this->line('Writing new environment configuration to file.'); foreach ($variables as $key => $value) { - $regex = '/^' . $key . '=(.*)$/m'; - $replace = $key . '=' . $value; - $envContents = preg_replace($regex, $replace, $envContents); + $newValue = $key . '=' . $value; + if (preg_match_all('/^' . $key . '=(.*)$/m', $envContents) < 1) { + $envContents = $envContents . "\n" . $newValue; + } else { + $envContents = preg_replace('/^' . $key . '=(.*)$/m', $newValue, $envContents); + } $bar->advance(); } diff --git a/composer.json b/composer.json index ad5a18ac9..c509c31a7 100644 --- a/composer.json +++ b/composer.json @@ -74,13 +74,17 @@ "sed -i.bak 's/homestead.app/pterodactyl.local/g' Homestead.yaml", "rm Homestead.yaml.bak", "php artisan key:generate", - "php artisan pterodactyl:env" + "php artisan pterodactyl:env", + "php artisan migrate", + "php artisan pterodactyl:user" ], "setup": [ "composer install --ansi --no-dev", "php -r \"copy('.env.example', '.env');\"", "php artisan key:generate", - "php artisan pterodactyl:env" + "php artisan pterodactyl:env", + "php artisan migrate", + "php artisan pterodactyl:user" ] }, "config": {