diff --git a/src/Plugin.php b/src/Plugin.php
index 421e1ed..2e6f7ea 100644
--- a/src/Plugin.php
+++ b/src/Plugin.php
@@ -83,6 +83,14 @@ public static function getSubscribedEvents()
*/
public function installOrUpdateFunction(PackageEvent $event): void
{
+ if ($this->isPluginDisabled()) {
+ $this->getIO()->write(' plugin is disabled');
+ return;
+ }
+ if (getenv('CI') === 'true') {
+ $this->getIO()->write(' disabling plugin due to CI-environment');
+ return;
+ }
// download phar and check signature
parent::installOrUpdateFunction($event);
// try to configure and install hooks
@@ -100,16 +108,6 @@ public function configureHooks(): void
$this->isPackageUpdate = true;
$this->getIO()->write('CaptainHook');
- if ($this->isPluginDisabled()) {
- $this->getIO()->write(' plugin is disabled');
- return;
- }
-
- if (getenv('CI') === 'true') {
- $this->getIO()->write(' disabling plugin due to CI-environment');
- return;
- }
-
$this->detectConfiguration();
$this->detectGitDir();
$this->detectCaptainExecutable();
@@ -218,11 +216,11 @@ private function detectCaptainExecutable(): void
{
$extra = $this->getComposer()->getPackage()->getExtra();
if (isset($extra['captainhook']['exec'])) {
- $this->executable = $extra['captainhook']['exec'];
+ $this->executable = (string) $extra['captainhook']['exec'];
return;
}
- $this->executable = (string) $this->getComposer()->getConfig()->get('bin-dir') . '/captainhook';
+ $this->executable = $this->getComposer()->getConfig()->get('bin-dir') . '/captainhook';
}
/**