#367: Support BSD style output in touch rule (#830)

On a Mac, also on NetBSD or OpenBSD, `touch` errs differently:

```
$ uname; touch a/b/c
Darwin
touch: a/b/c: No such file or directory
```

That gets matched by the rule but not fixed by it. Thus the regex
pattern is now a bit more tolerant.
This commit is contained in:
Pablo Aguiar
2018-07-29 17:18:42 +01:00
committed by Vladimir Iakovlev
parent 4e755e4799
commit cc6d90963e
2 changed files with 18 additions and 9 deletions
+2 -1
View File
@@ -9,5 +9,6 @@ def match(command):
def get_new_command(command):
path = re.findall(r"touch: cannot touch '(.+)/.+':", command.output)[0]
path = path = re.findall(
r"touch: (?:cannot touch ')?(.+)/.+'?:", command.output)[0]
return shell.and_(u'mkdir -p {}'.format(path), command.script)