Skip to content

Commit

Permalink
[ Fix ] Validate command instructions (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjektGopher committed Aug 11, 2023
1 parent 2e6d1ff commit 697f1b8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Commands/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use LaravelZero\Framework\Commands\Command;
use ProjektGopher\Whisky\FileJson;
use ProjektGopher\Whisky\Platform;
use ProjektGopher\Whisky\Whisky;

class Validate extends Command
{
Expand All @@ -16,8 +17,13 @@ class Validate extends Command
public function handle(): int
{
if (File::missing(Platform::cwd('whisky.json'))) {
$cmd = match (true) {
Whisky::dogfooding() => 'php whisky install',
Whisky::isRunningGlobally() => 'whisky install',
default => 'vendor/bin/whisky install',
};
$this->error('Whisky has not been initialized in this project, aborting...');
$this->line('Run `./vendor/bin/whisky install` to initialize Whisky in this project.');
$this->line("Run `{$cmd}` to initialize Whisky in this project.");

return Command::FAILURE;
}
Expand Down

0 comments on commit 697f1b8

Please sign in to comment.