Closed (fixed)
Project:
Boilerplate
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 May 2012 at 03:55 UTC
Updated:
30 Jan 2013 at 18:20 UTC
Jump to comment: Most recent file
The drush boilerplate command uses drush_locate_root() to determine the path for drupal's root. Unfortunately drush_locate_root() is only able to return a valid path when drush is invoked from within the drupal tree:
cd /usr/local/www/drupal7/sites/foobar.com
drush bp foobar_theme
If instead one invokes it thusly from some random point in the filesystem:
drush @foobar bp foobar_theme
where @foobar is a site alias with values defined for drupal root and URI, then bp starts copying files in very strange places.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | boilerplate-params-1597846-6.patch | 1.29 KB | twardnw |
| #1 | boilerplate-params-1597846-1.patch | 1.49 KB | ericxb |
Comments
Comment #1
ericxb commentedSo here's a patch. It does 3 things:
drush_locate_root()withdrush_get_context(). The contexts are set by the bootstrap. Note that the boot strap callsdrush_locate_root()if root path is not otherwise provided by a param.system_rebuild_theme_data()before attemptingdrupal_get_path(). This is helpful becausedrupal_get_path()won't actually return the path to boilerplate if it has just been downloaded and the theme data has not been tickled. Without it, thenwill fail.
themes/custom/[newTheme]if themes is subdivided intothemes/contribandthemes/customI'm not really a competent drush geek. I just browsed thru the API and the source looking for likely solutions. Please ask thems that knows to take a look.
Comment #2
AaronA commentedWow, that's really interesting. We weren't necessarily planning on that level of drush support when we decided to add it (and if you take a look at Zen's drush.inc they could use help with the same issue), but I'll take a look and see if we can get it into a near future release. I just always liked the ease that Zen provides through drush and wanted to pass that on. Thanks for the patch.
Comment #3
ericxb commentedThis comes up on my dev machine. For my development staging all my projects end up in
/usr/local/www/src.[whatever]. To make that easier to live with, my.drush/aliases.drushrc.phphas an entry for each dev site. I don't know how commonly used drush aliases are; but I can't live without them.Thanks for considering it.
Comment #4
danlinn commentedComment #5
webkenny commentedI don't want to derail this issue but is anyone finding that when you run the drush bp command (even from within the site tree) that it creates an entirely new Drupal core in the folder? Wondering if any of this is related somehow.
Comment #6
twardnw commentedNot sure what was used to generated that patch, but I couldn't apply it...
Tested this out on my local environ by:
drush bpfrom inside the drupal treedrush bp @aliasfrom anywhere on my systemIn both cases, I also tested against there being a standard drupal path (sites/all/themes) and paths for custom and contrib (sites/all/themes/contrib sites/all/themes/custom). The command was able to place the new theme in the correct folder.
Attached is a patch generated by git.
Comment #7
twardnw commentedcommitted to -dev, authorship to ericxb