Skip to content

Commit

Permalink
Remove pre-check as package is always included
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jun 4, 2022
1 parent 16a5043 commit 076a1be
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
22 changes: 0 additions & 22 deletions src/Commands/HydeServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ class HydeServeCommand extends Command
*/
public function handle(): int
{
if (! $this->canRunServer()) {
$this->error('Could not start the server.');

return 1;
}

$this->line('<info>Starting the server...</info> Press Ctrl+C to stop');

$this->warn('This feature is experimental. Please report any issues on GitHub.');
Expand All @@ -51,20 +45,4 @@ public function handle(): int

return 0;
}

/**
* Check if the server can be started.
*
* @return bool
*/
protected function canRunServer(): bool
{
if (! file_exists(Hyde::path('vendor/hyde/realtime-compiler/server.php'))) {
$this->warn('The realtime compiler extension is not installed.');

return false;
}

return true;
}
}
12 changes: 0 additions & 12 deletions tests/Feature/Commands/HydeServeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,4 @@ public function test_hyde_serve_command()
->expectsOutput('This feature is experimental. Please report any issues on GitHub.')
->assertExitCode(0);
}

public function test_hyde_serve_command_exits_when_compiler_is_not_installed()
{
backup(Hyde::path('vendor/hyde/realtime-compiler/server.php'));
unlink(Hyde::path('vendor/hyde/realtime-compiler/server.php'));

$this->artisan('serve')
->expectsOutput('Could not start the server.')
->assertExitCode(1);

restore(Hyde::path('vendor/hyde/realtime-compiler/server.php'));
}
}

0 comments on commit 076a1be

Please sign in to comment.