Skip to content

Commit

Permalink
#1 Fix dist file copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
hkirsman committed Jun 28, 2024
1 parent 26d3608 commit 4b339fb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/InstallHelperPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,25 +137,25 @@ public function onWunderIoDrupalGitlabLocalPipelinesPackageUpdate(PackageEvent $
private function deployDistFiles(): void {
$dest_dir = "{$this->projectDir}";

$paths_to_force_copy = [
$dist_paths_to_force_copy = [
'.grumphp.yml',
];

$path_to_copy_if_not_exists = [
$dist_path_to_copy_if_not_exists = [
// According to https://project.pages.drupalcode.org/gitlab_templates/jobs/phpcs/
// module can have it's own phpcs.xml file. So let's not overwrite it.
'.phpcs.xml',
];

// Copy files to project root.
foreach ($paths_to_force_copy as $path) {
$src = "{$this->vendorDir}/" . self::PACKAGE_NAME . "/$path";
foreach ($dist_paths_to_force_copy as $path) {
$src = "{$this->vendorDir}/" . self::PACKAGE_NAME . "/dist/$path";
self::copy($src, $dest_dir);
}

// Copy files to project root if they don't exist.
foreach ($path_to_copy_if_not_exists as $path) {
$src = "{$this->vendorDir}/" . self::PACKAGE_NAME . "/$path";
foreach ($dist_path_to_copy_if_not_exists as $path) {
$src = "{$this->vendorDir}/" . self::PACKAGE_NAME . "/dist/$path";
if (!file_exists("$dest_dir/$path")) {
self::copy($src, $dest_dir);
}
Expand Down

0 comments on commit 4b339fb

Please sign in to comment.