mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 20:38:54 +00:00
Merge pull request #389 from scorphus/fix-touch
Fix `rules.touch` tests
This commit is contained in:
commit
12a33f56bc
@ -1,6 +1,6 @@
|
|||||||
import re
|
import re
|
||||||
|
from thefuck import shells
|
||||||
from thefuck.utils import for_app
|
from thefuck.utils import for_app
|
||||||
from thefuck.shells import and_
|
|
||||||
|
|
||||||
|
|
||||||
@for_app('touch')
|
@for_app('touch')
|
||||||
@ -10,4 +10,4 @@ def match(command):
|
|||||||
|
|
||||||
def get_new_command(command):
|
def get_new_command(command):
|
||||||
path = re.findall(r"touch: cannot touch '(.+)/.+':", command.stderr)[0]
|
path = re.findall(r"touch: cannot touch '(.+)/.+':", command.stderr)[0]
|
||||||
return and_(u'mkdir -p {}'.format(path), command.script)
|
return shells.and_(u'mkdir -p {}'.format(path), command.script)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user