- Issue created by @amstercad
- @amstercad opened merge request.
Lee, this is actually using the starterkit to build the theme if you test it, drush is just a wrapper around it for two reasons:
- backward compatibility
- other goodies being done besides just a copy-pasteyou can try to check the files in play for the theme creation here: https://git.drupalcode.org/project/radix/-/tree/6.0.x/Commands/radix?ref...
closing this
- Status changed to Closed: works as designed
about 1 year ago 8:54am 19 November 2023 - πΊπΈUnited States ramez.gaberiel
This is somewhat related but not entirely the same issue, the radix:create instruction only works assuming the user is using drupal/recommended-project, and hard codes the 'web' directory inside the drush commands.
Would there be any opposition to making it more universal and remove the hardcoded 'web' directory from the drush commands and do something like this instead? Or is there a specific reason the generate starterkit instruction should only work with drupal/recommended project installations?
<?php use Drush\Drush; . . . public function createSubTheme(string $name) { $drupal_root = Drush::bootstrapManager()->getRoot(); try { $this->copyStarterKit($drupal_root); $this->generateTheme($name, $drupal_root); $this->removeCopiedStarterKit($drupal_root); . . . private function copyStarterKit(string $drupal_root) { $filesystem = new Filesystem(); $source = "$drupal_root/themes/contrib/radix/src/kits/radix_starterkit"; $destination = "$drupal_root/themes/custom/radix_starterkit"; $filesystem->mirror($source, $destination); } . . . ?>
Good point ramez, not sure if there's a way to get the active directory of Drupal, I have to check, not sure if
$drupal_root
would translate into that or just the main drupal rootI could possibly look into it later, but would appreciate a MR
- Status changed to Needs work
about 1 year ago 6:54am 22 November 2023 - πΊπΈUnited States amstercad
IMHO, both the drush script and the core Drupal script should be supported, and why not? They both work so long as the Starterkit code meets the required specification. And valid documentation mentioning support for both scripts should exist.
If the drush script offers more features and documents make that clear, then good. Many people will use Radix having used other themes before, and those themes might be using the Drupal core script at
core/scripts/drupal
. True, those are two different scripts with diverging capabilities perhaps, but either will get the job done. At the end of the day, I think it is fair to say that's what people want and if there's no additional development costs, why not support both scripted methods?One script only requires PHP while the other script requires a drush setup that some people might find too much of a hassle for the purpose.
All valid points Lee,
Radix is rather a professional-level theme I'd say, so anyone here knows how to get around and use drush, at least they should if they don't.
We are currently supporting both approaches,
drush radix:create
just uses the core starterkit under the hood (even though it doesn't really matter what approach we use as long as we get the subtheme built)I'd say Ramez is on a good angle, we need to make sure not to hardcode the
web
directory if it's possible, I'll look into it later when I get some free timeAnyways fixed it using
Drush::bootstrapManager()->getRoot()
, crediting you both. thanks- Status changed to Fixed
about 1 year ago 4:03pm 24 November 2023 Automatically closed - issue fixed for 2 weeks with no activity.