|
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
|
|
|
|
|
namespace Fgm\Drupal\Composer;
|
|
namespace Fgm\Drupal\Composer;
|
|
|
|
|
|
|
|
+require_once __DIR__ . '/../../../../vendor/autoload.php';
|
|
|
|
+
|
|
use Composer\Command\BaseCommand;
|
|
use Composer\Command\BaseCommand;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
@@ -45,7 +47,7 @@ abstract class BaseBuilderCommand extends BaseCommand {
|
|
* @param \Symfony\Component\Console\Output\OutputInterface $output
|
|
* @param \Symfony\Component\Console\Output\OutputInterface $output
|
|
* Command output.
|
|
* Command output.
|
|
* @param string $buildName
|
|
* @param string $buildName
|
|
- * The nature of the build: services, settings, etc.
|
|
|
|
|
|
+ * The template name as a composer.json extra section.
|
|
*
|
|
*
|
|
* @return array
|
|
* @return array
|
|
* - string Template name
|
|
* - string Template name
|
|
@@ -59,10 +61,12 @@ abstract class BaseBuilderCommand extends BaseCommand {
|
|
$conf = $this->getComposer()->getPackage()->getExtra()[Builder::NAME] ?? [];
|
|
$conf = $this->getComposer()->getPackage()->getExtra()[Builder::NAME] ?? [];
|
|
$templateName = $conf['templates'][$buildName] ?? '';
|
|
$templateName = $conf['templates'][$buildName] ?? '';
|
|
if (empty($templateName)) {
|
|
if (empty($templateName)) {
|
|
- $output->writeln(sprintf(
|
|
|
|
- 'Could not build file %s: no such template in composer.json extra section',
|
|
|
|
- $buildName
|
|
|
|
- ));
|
|
|
|
|
|
+ $output->writeln(
|
|
|
|
+ sprintf(
|
|
|
|
+ 'Could not build file %s: no such template in composer.json extra section',
|
|
|
|
+ $buildName
|
|
|
|
+ )
|
|
|
|
+ );
|
|
return ["", 1];
|
|
return ["", 1];
|
|
}
|
|
}
|
|
return [$templateName, 0];
|
|
return [$templateName, 0];
|