On Wed, May 14, 2014 at 01:52:17PM +0100, Richard Ipsum wrote:
try:
- return self._app.runcmd(real_argv, **kwargs)
+ if 'logfile' in kwargs:
+ logfile = kwargs['logfile']
+ del kwargs['logfile']
+
+ if logfile:
+ teecmd = ['tee', '-a', logfile]
+ return self._app.runcmd(real_argv, teecmd, **kwargs)
+ else:
+ return self._app.runcmd(real_argv, **kwargs)
except cliapp.AppException as e:
raise cliapp.AppException('In staging area %s: running '
'command \'%s\' failed.' %
What happens if kwargs does not contain logfile? Looks to me like the
code doesn't run anything at all then.
--
http://www.codethink.co.uk/ http://wiki.baserock.org/ http://www.baserock.com/