diff --git a/thefuck/logs.py b/thefuck/logs.py index 7f97a33c..9e197e6c 100644 --- a/thefuck/logs.py +++ b/thefuck/logs.py @@ -8,6 +8,7 @@ import colorama from .conf import settings from . import const + def color(color_): """Utility for ability to disabling colored output.""" if settings.no_colors: diff --git a/thefuck/rules/cd_mkdir.py b/thefuck/rules/cd_mkdir.py index 6eb9a935..2aa1ce09 100644 --- a/thefuck/rules/cd_mkdir.py +++ b/thefuck/rules/cd_mkdir.py @@ -2,7 +2,7 @@ import re from thefuck.utils import for_app from thefuck.specific.sudo import sudo_support from thefuck.shells import shell - +import os @sudo_support @for_app('cd') @@ -19,5 +19,5 @@ def match(command): @sudo_support def get_new_command(command): - repl = shell.and_('mkdir -p \\1', 'cd \\1') + repl = 'mkdir -p \\1; cd \\1' return re.sub(r'^cd (.*)', repl, command.script) diff --git a/thefuck/rules/chdir.py b/thefuck/rules/chdir.py index eda9a704..28da9290 100644 --- a/thefuck/rules/chdir.py +++ b/thefuck/rules/chdir.py @@ -17,5 +17,5 @@ def match(command): @sudo_support def get_new_command(command): - repl = shell.and_('mkdir -p \\1', 'chdir \\1') + repl = 'mkdir -p \\1; chdir \\1' return re.sub(r'^chdir(.*)', repl, command.script)