diff options
-rw-r--r-- | NEWS | 4 | ||||
-rwxr-xr-x | yarn | 12 |
2 files changed, 15 insertions, 1 deletions
@@ -14,6 +14,10 @@ Version 0.19, released UNRELEASED This can be used to use Python instead of sh: `--shell=/usr/bin/python2 --shell-arg=''`. +* Yarn now supports the `--cd-datadir` setting to have each step run + in `DATADIR` instead of `SRCDIR`. The default remains `SRCDIR`, but + at some point in the future, the default will probably change. + Version 0.18, released 2015-11-06 --------------------------------- @@ -100,6 +100,11 @@ class YarnRunner(cliapp.Application): metavar='ARG', default=['-xeu']) + self.settings.boolean( + ['cd-datadir'], + 'change to DATADIR when running commands', + default=False) + def stdout(self, msg): self.output.write(msg) self.output.flush() @@ -448,6 +453,11 @@ class YarnRunner(cliapp.Application): for i, match in enumerate(m.groups('')): env['MATCH_%d' % (i+1)] = match + if self.settings['cd-datadir']: + cwd = datadir + else: + cwd = '.' + fd, shell_script = tempfile.mkstemp() os.close(fd) with open(shell_script, 'w') as f: @@ -460,7 +470,7 @@ class YarnRunner(cliapp.Application): logging.warning('shell_args: %r', shell_args) logging.warning('shell_script: %r', shell_script) exit, stdout, stderr = cliapp.runcmd_unchecked( - [shell] + shell_args + [shell_script], env=env) + [shell] + shell_args + [shell_script], env=env, cwd=cwd) os.remove(shell_script) logging.debug('Exit code: %d' % exit) |