forked from neronmoon/scriptsdev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.php
More file actions
28 lines (22 loc) · 708 Bytes
/
Copy pathPlugin.php
File metadata and controls
28 lines (22 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
namespace ScriptsDev;
use Composer\Composer;
use Composer\IO\IOInterface;
use Composer\Plugin\Capable;
use Composer\Plugin\PluginInterface;
class Plugin implements PluginInterface, Capable
{
public function getCapabilities()
{
return array(
'Composer\Plugin\Capability\CommandProvider' => 'ScriptsDev\DevScriptsCommandProvider',
);
}
public function activate(Composer $composer, IOInterface $io)
{
$package = $composer->getPackage();
$extractor = new PackageScriptsExtractor($io);
$devScripts = $extractor->extract($package);
$package->setScripts(array_merge_recursive($package->getScripts(), $devScripts));
}
}