5 * Contains \Drupal\Console\Generator\ThemeGenerator.
8 namespace Drupal\Console\Generator;
10 use Drupal\Console\Core\Generator\Generator;
11 use Drupal\Console\Extension\Manager;
16 class ThemeGenerator extends Generator
21 protected $extensionManager;
24 * AuthenticationProviderGenerator constructor.
26 * @param Manager $extensionManager
28 public function __construct(
29 Manager $extensionManager
31 $this->extensionManager = $extensionManager;
34 public function generate(
46 $dir .= '/' . $machine_name;
47 if (file_exists($dir)) {
49 throw new \RuntimeException(
51 'Unable to generate the bundle as the target directory "%s" exists but is a file.',
56 $files = scandir($dir);
57 if ($files != ['.', '..']) {
58 throw new \RuntimeException(
60 'Unable to generate the bundle as the target directory "%s" is not empty.',
65 if (!is_writable($dir)) {
66 throw new \RuntimeException(
68 'Unable to generate the bundle as the target directory "%s" is not writable.',
77 'machine_name' => $machine_name,
80 'description' => $description,
81 'package' => $package,
82 'base_theme' => $base_theme,
83 'global_library' => $global_library,
84 'regions' => $regions,
85 'breakpoints' => $breakpoints,
89 'theme/info.yml.twig',
90 $dir . '/' . $machine_name . '.info.yml',
96 $dir . '/' . $machine_name . '.theme',
102 'theme/breakpoints.yml.twig',
103 $dir . '/' . $machine_name . '.breakpoints.yml',