backdrop-contrib / backdrop-drush-extension

A set of commands and boot class for Drush and Backdrop CMS.
GNU General Public License v2.0
13 stars 18 forks source link

Add support for module/theme/layout subfolders #72

Open ghost opened 7 years ago

ghost commented 7 years ago

Normal drush (i.e. Drupal) doesn't mind if you organise you modules into subfolders. E.g.:

modules/
|-- contrib/
|   |-- devel/
|   |-- styleguide/
|-- custom/
|   |-- my_module/
|-- sandbox/
|   |-- my_test_module/

Whereas Backdrop's drush doesn't like custom subfolders (I keep getting WARNING: There is no project devel intalled on your backdrop site. messages when trying to update them)...

I'd like to request allowing any subfolder structure under modules/, themes/ and layouts/.


PR: https://github.com/backdrop-contrib/drush/pull/87

mikemccaffrey commented 7 years ago

Other than the issue with drush, are the custom folders working alright wit the rest of backdrop?

ghost commented 7 years ago

Other than the issue with drush, are the custom folders working alright wit the rest of backdrop?

Yep, absolutely!

serundeputy commented 7 years ago

@BWPanda thanks for reporting.

hmm ... backdrop-drush is supposed to check for a contrib folder as well. It certainly can drush dl to the contrib location.

That being said I'm going to mark this as a bug as it should allow you to do this.

serundeputy commented 7 years ago

PR: https://github.com/backdrop-contrib/drush/pull/87

@BWPanda There were at least a couple of factors going on here.

I never got the error:

WARNING: There is no project devel intalled on your backdrop site.

Are you on a multisite? Backdrop drush does not know how to handle multisites yet (https://github.com/backdrop-contrib/drush/issues/37)

I tried to replicate your problem with an earlier version of devel and that was failing because that version of devel did not have a version string in the devel.info file so drush could not determine the existing version and therefore not tell if there are newer versions available.

The PR fails more gracefully in that situation now:

geoff@yep contrib $ drush up devel
    Current module version of devel could not be determined.
    This is usually because the module doesn't have and official release.

There was also an issue that some modules prefaces there sem version string with a backrop compatibility string like 1.x-1.7.0. This PR checks for that now and should allow updating.

Backdrop drush does check for the directories modules/contrib but not for nested multisites.

Can you report back if your issue is because of multisite? If so we'll handle that in https://github.com/backdrop-contrib/drush/issues/37 (which I definitely need help with (I'm not a multisite user myself)) or if you can replicate in a single site report your steps.

Thanks for reporting! Every report helps move things along a little more.

~Geoff

serundeputy commented 7 years ago

I've merged in the changes in #87 as they are in the same file that the requests for #66 and I don't want to block that one.

I will leave this one open until @BWPanda reports back if it is multisite problem or something else.

ghost commented 7 years ago

Nope, not a multisite. It's an existing site I have running, so not sure about steps to reproduce... I'll just tell you what I have setup:

Backdrop: 1.5.2 Drush: 8.1.2

I also noticed that drush dl webform run from /var/www/[bd_dir]/modules/sandbox ('sandbox' is a custom directory within 'modules', like 'contrib' or 'custom' from the original post) displays: Project webform downloaded to /var/www/[bd_dir]/modules/webform...

I can mv ../webform/ . and then enable it via the web UI, and it works fine. But then running drush up webform results in:

This command is not supported yet by Backdrop.                          [failed]

        WARNING: There is no project webform intalled on your backdrop site.
        No action taken.

Hope that helps. Let me know if you need any further info.

klonos commented 7 years ago

...if the above was a copy-paste, then there is also a typo in "installed" (missing s).

serundeputy commented 7 years ago

Ahh; thanks @BWPanda that makes sense drush is currently only checking for either BACKDROP_ROOT/modules or BACKDROP_ROOT/modules/contrib since you have a subdir named sandbox that explains the failure.

I'll have to think about how to support arbitrary sub directories.

@klonos thanks; fixed typo.

jenlampton commented 6 years ago

Also...

This command is not supported yet by Backdrop.

ghost commented 6 years ago

@jenlampton Sorry, I have a bash alias dup that runs drush rf && drush up. It was the rf that was triggering the 'not supported yet' message.