mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-30 14:44:05 +00:00
Fix rules.touch tests
Move them to `rules` sub-directory and import `shells` instead of `and_` which in turn triggers the `generic_shell` fixture fixing the tests on Fish Shell.
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user