Skip to content
Snippets Groups Projects

Issue #3447412: replace abandoned package

Open aaron.ferris requested to merge issue/gesso-3447412:3447412-drush-gesso-new into 5.x
1 unresolved thread
@@ -10,7 +10,7 @@ use Drupal\gesso_helper\GessoHelperDirFilterInclude;
use Drush\Commands\DrushCommands;
use Drush\Drush;
use Symfony\Component\Filesystem\Filesystem;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;
/**
* A Drush commandfile.
@@ -117,8 +117,22 @@ class GessoHelperCommands extends DrushCommands implements SiteAliasManagerAware
$theme_path = substr($gesso_path, 0, strrpos($gesso_path, '/'));
$new_path = Path::join($theme_path, $machine_name);
// Copy the Gesso theme directory recursively to the new theme’s location.
$this->fs->mirror($gesso_path, $new_path, new \RecursiveIteratorIterator(new GessoHelperDirFilterExclude(new \RecursiveDirectoryIterator($gesso_path))), \RecursiveIteratorIterator::SELF_FIRST);
// Assuming $this->fs is an instance of Symfony\Component\Filesystem\Filesystem
// Example options array (you can adjust these as needed)
$options = [
'override' => true, // Whether to override existing files
'copy_on_windows' => true, // Whether to copy on Windows (useful for symbolic links)
// Add more options here if needed
];
// Call the mirror method with the correct arguments
$this->fs->mirror(
$gesso_path, // Source directory
$new_path, // Target directory
null, // Copy the files recursively by default (no need for recursive iterator)
$options // Array of options
);
// Replace specific occurrences of 'gesso'
// with the machine name of the new theme.
Loading