$source_version =
$info['version'
] ?? 'unknown-version';
if ($source_version === 'VERSION'
) { $source_version = \Drupal::VERSION;
} // A version in the generator string like "9.4.0-dev" is not very helpful.
// When this occurs, generate a version string that points to a commit.
if (VersionParser::
parseStability($source_version) === 'dev'
) { $git_check = Process::
fromShellCommandline('git --help'
);
$git_check->
run();
if ($git_check->
getExitCode()) { $io->
error(sprintf('The source theme %s has a development version number (%s). Determining a specific commit is not possible because git is not installed. Either install git or use a tagged release to generate a theme.',
$source_theme->
getName(),
$source_version));
return 1;
} // Get the git commit for the source theme.
$git_get_commit = Process::
fromShellCommandline("git rev-list --max-count=1 --abbrev-commit HEAD -C
$source"
);
$git_get_commit->
run();
if ($git_get_commit->
getOutput() === ''
) { $confirm_packaged_dev_release =
new ConfirmationQuestion(sprintf('The source theme %s has a development version number (%s). Because it is not a git checkout, a specific commit could not be identified. This makes tracking changes in the source theme difficult. Are you sure you want to continue?',
$source_theme->
getName(),
$source_version));
if (!
$io->
askQuestion($confirm_packaged_dev_release)) { return 0;
}