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(
47 $dir .= '/' . $machine_name;
48 if (file_exists($dir)) {
50 throw new \RuntimeException(
52 'Unable to generate the bundle as the target directory "%s" exists but is a file.',
57 $files = scandir($dir);
58 if ($files != ['.', '..']) {
59 throw new \RuntimeException(
61 'Unable to generate the bundle as the target directory "%s" is not empty.',
66 if (!is_writable($dir)) {
67 throw new \RuntimeException(
69 'Unable to generate the bundle as the target directory "%s" is not writable.',
78 'machine_name' => $machine_name,
81 'description' => $description,
82 'package' => $package,
83 'base_theme' => $base_theme,
84 'global_library' => $global_library,
85 'libraries' => $libraries,
86 'regions' => $regions,
87 'breakpoints' => $breakpoints,
91 'theme/info.yml.twig',
92 $dir . '/' . $machine_name . '.info.yml',
98 $dir . '/' . $machine_name . '.theme',
104 'theme/libraries.yml.twig',
105 $dir . '/' . $machine_name . '.libraries.yml',
112 'theme/breakpoints.yml.twig',
113 $dir . '/' . $machine_name . '.breakpoints.yml',