$io->
getErrorStyle()->
error("Theme source theme
$source_theme_name is not a valid starter kit."
);
return 1;
} $source =
$source_theme->
getPath();
if (!
is_dir($source)) { $io->
getErrorStyle()->
error("Theme could not be generated because the source directory
$source does not exist."
);
return 1;
} $tmp_dir =
$this->
getUniqueTmpDirPath();
$this->
copyRecursive($source,
$tmp_dir);
// Readme is specific to Starterkit, so remove it from the generated theme.
$readme_file = "
$tmp_dir/README.md";
if (!
file_put_contents($readme_file, "
$destination_theme theme, generated from
$source_theme_name. Additional information on generating themes can be found in the [Starterkit documentation](https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme)."
)) { $io->
getErrorStyle()->
error("The readme could not be rewritten."
);
return 1;
} // Rename files based on the theme machine name.
$file_pattern = "/
$source_theme_name\.(theme|[^.]+\.yml)/";