Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
User Commands
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Nov 2012 at 08:55 UTC
Updated:
11 Sep 2013 at 11:34 UTC
Shell alias replacements can support arbitrary items via the {{sitealias-item}} pattern. I run into a problem when I try to set a site_name item for the purposes of a shell alias replacement (I want to update various variable settings on a dev site after syncing it with the production DB): if I try to do something like !drush {{@target}} vset site_name {{site_name}} where the site_name in the alias is something like "Example Site Dev", the site_name will successfully get set to "Example". The shell alias grabs values and splits on the spaces to set up the command arguments, which means values with spaces get split into arguments.
Comments
Comment #1
greg.1.anderson commentedDoes
!drush {{@target}} vset site_name "{{site_name}}"work for you?Comment #2
hackwater commentedNo, because the quoted string still has spaces. When it hits line 1764 in includes/command.inc, it splits the string, so in this case it would get set to
"Example. Via an ugly hack, I can force it to preserve the string through theexplode?>, but it's not really a feasible solution: I perform a
rawurlencodeon the values coming in from line 1745 if they contain a space. After theexplodeon line 1764, I go through the array and look for a %20 string in its values, and convert it.Like I said: ugly.
Comment #3
greg.1.anderson commentedYeah, that's a problem. To fix this, we'd need a replacement for php's explode function that will respect quoted character sequences. Patches welcome.
Comment #4
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.