Skip to content

Commit 132b658

Browse files
committed
tweak command output.
1 parent f47b234 commit 132b658

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Illuminate/Foundation/Console/KeyGenerateCommand.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,18 @@ public function fire()
4141
{
4242
$contents = $this->files->get($path = $this->laravel['path'].'/config/app.php');
4343

44-
$contents = str_replace('YourSecretKey!!!', $key = $this->getRandomKey(), $contents);
44+
$contents = str_replace('YourSecretKey!!!', $key = $this->getRandomKey(), $contents, $count);
4545

46-
$this->files->put($path, $contents);
46+
if ($count == 0)
47+
{
48+
$this->comment('Application key has already been set.');
49+
}
50+
else
51+
{
52+
$this->files->put($path, $contents);
4753

48-
$this->info("Application key [$key] set successfully.");
54+
$this->info("Application key [$key] set successfully.");
55+
}
4956
}
5057

5158
/**

0 commit comments

Comments
 (0)