Skip to content

Commit

Permalink
Add grumphp-config creation
Browse files Browse the repository at this point in the history
Adds creation of the GrumPHP-Configuration-file to the setup process
  • Loading branch information
heiglandreas committed Mar 10, 2019
1 parent 98ff54f commit fc8af57
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Composer/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Composer\Plugin\PluginInterface;
use Composer\Script\Event;
use Composer\Script\ScriptEvents;
use function file_exists;
use function getcwd;
use SplFileInfo;

Expand Down Expand Up @@ -62,14 +63,20 @@ public function prepareForPackage(PackageEvent $event) : void
$modifier($dispatcher);
}

public static function installScript(Event $event) : void
public function installScript(Event $event) : void
{
if (! file_exists(getcwd() . '/grumphp.yml')) {
exec('./vendor/bin/grumphp configure --no-interaction');
}
$adder = new GrumPHPAdder(new SplFileInfo(getcwd() . '/captainhook.json'));
$adder();
}

public static function installPackage(PackageEvent $event) : void
public function installPackage(PackageEvent $event) : void
{
if (! file_exists(getcwd() . '/grumphp.yml')) {
exec('./vendor/bin/grumphp configure --no-interaction');
}
$adder = new GrumPHPAdder(new SplFileInfo(getcwd() . '/captainhook.json'));
$adder();
}
Expand Down

0 comments on commit fc8af57

Please sign in to comment.