diff --git a/src/PatternLab/InstallerUtil.php b/src/PatternLab/InstallerUtil.php index 66a3fab5..5aea2fd6 100644 --- a/src/PatternLab/InstallerUtil.php +++ b/src/PatternLab/InstallerUtil.php @@ -289,6 +289,13 @@ public static function parseComposerExtraList($composerExtra, $name, $pathDist) } + if (isset($composerExtra["installScripts"])) { + foreach ($composerExtra["installScripts"] as $script) { + // scripts are relative to the dist directory + self::runInstallScript($pathDist, $script); + } + } + } /** @@ -768,4 +775,11 @@ protected static function scanForPatternEngineRule($pathPackage,$remove = false) } + protected static function runInstallScript($path, $script) { + $script_filename = $path . DIRECTORY_SEPARATOR . $script; + if (file_exists($script_filename)) { + include($script_filename); + } + } + }