Closed (duplicate)
Project:
Drush
Component:
Core Commands
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2011 at 14:27 UTC
Updated:
17 Nov 2011 at 17:24 UTC
Jump to comment: Most recent file
I noticed that I got a TRUE status from drush_shell_exec_interactive() even though the executed command ended in error.
I looked up the code and found that what is returned is "the status of being able to start an execution", not the result of the execution itself.
Maybe there is a good reason for wanting to know the first, but it doesn't really make sense to me to do it this way...
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | drush-1343488-drush_shell_exec_interactive_returns_wrong.patch | 1000 bytes | helmo |
Comments
Comment #1
jdonson commentedSeems useful for exec debug mode, but I see your point.
Comment #2
helmo commentedHere's a patch to review, I've also added a drush_log() line which logs the actual exit code when using debug mode.
Comment #3
greg.1.anderson commentedYes, good catch. It would be even better to have interactive mode call
drush_shell_proc_open, and thenreturn ($result === 0) ? TRUE : FALSE;.Comment #4
helmo commented@greg I just tried.
But I don't understand why the code below exists in drush_shell_proc_open()
--debug trigers DRUSH_VERBOSE right? But why should that prevent executing the command?
Comment #5
greg.1.anderson commenteddrush_shell_proc_open is kind of new. The issue you point out in #4 is indeed a bug. 'return 0' should happen on DRUSH_SIMULATE, but not DRUSH_VERBOSE. The drush_print should happen for both.
Comment #6
helmo commented@greg: why drush_print and not drush_log? It seems to me that checking for DRUSH_VERBOSE should be done elsewhere.
Apart from a single white-space error this patch seems ok, drush_shell_proc_open could be a separate issue. Or extra patch here.
Comment #7
greg.1.anderson commentedFine, I'll fix this in #1342940: Simplify documentation for shell alias replacements per #3.