diff --git a/src/Commands/BreezejpCommand.php b/src/Commands/BreezejpCommand.php index be85142..fdade51 100644 --- a/src/Commands/BreezejpCommand.php +++ b/src/Commands/BreezejpCommand.php @@ -25,7 +25,9 @@ public function handle(): int (new Filesystem)->ensureDirectoryExists(lang_path()); (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/lang/', lang_path()); - if (file_exists(base_path('config/app.php'))) { + $envfile = file_get_contents(base_path('.env')); + + if (strpos($envfile, "APP_FAKER_LOCALE") == false) { $this->info('config/app.phpのlocaleをjaにします'); // Read the contents of the file into a string $configfile = file_get_contents(base_path('config/app.php')); @@ -70,8 +72,6 @@ public function handle(): int $configfile = str_replace('APP_FAKER_LOCALE=en_US', 'APP_FAKER_LOCALE=ja_JP', $configfile); $configfile = str_replace('APP_TIMEZONE=UTC', 'APP_TIMEZONE=Asia/Tokyo', $configfile); - var_dump($configfile); - // Save the modified contents back to the file file_put_contents(base_path('.env'), $configfile); diff --git a/tests/CommandTest.php b/tests/CommandTest.php index b46c560..09d7bfd 100644 --- a/tests/CommandTest.php +++ b/tests/CommandTest.php @@ -2,7 +2,6 @@ test('.env file exists', function () { $this->assertFileExists(base_path('.env')); - var_dump(file_get_contents(base_path('.env'))); }); test('breezejp command successfully run and see all the published files', closure: function () {