Skip to content

Commit

Permalink
Enhance output
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Feldmann committed Mar 30, 2021
1 parent 0c1e712 commit 0ae62ae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function installOrUpdateFunction(PackageEvent $event): void
*/
public function installHooks(): void
{
$this->getIO()->write('<info>CaptainHook Composer Plugin</info>');
$this->getIO()->write('<info>CaptainHook</info>');

if ($this->isPluginDisabled()) {
$this->getIO()->write(' <comment>plugin is disabled</comment>');
Expand Down Expand Up @@ -114,22 +114,28 @@ public function installHooks(): void
*/
private function configure(): void
{
$this->getIO()->write(' - Detect configuration: ', false);
if (file_exists($this->configuration)) {
$this->getIO()->write((' <comment>Using CaptainHook config: ' . $this->configuration . '</comment>'));
$this->getIO()->write('<comment>found ' . $this->configuration . '</comment>');
return;
}

$this->getIO()->write('<comment>no configuration found</comment>');

$runner = new Captain($this->executable, $this->configuration, $this->gitDirectory);
$runner->execute(Captain::COMMAND_CONFIGURE, $this->getIO());

}

/**
* Install hooks to your .git/hooks directory
*/
private function install(): void
{
$this->getIO()->write(' - Install hooks: ', false);
$runner = new Captain($this->executable, $this->configuration, $this->gitDirectory);
$runner->execute(Captain::COMMAND_INSTALL, $this->getIO());
$this->getIO()->write(('<comment> done</comment>'));
}

/**
Expand Down

0 comments on commit 0ae62ae

Please sign in to comment.