mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 09:39:01 +00:00
fixed chdir and a typo in logs
This commit is contained in:
parent
e45e772ae6
commit
81d2a5abd4
@ -8,6 +8,7 @@ import colorama
|
|||||||
from .conf import settings
|
from .conf import settings
|
||||||
from . import const
|
from . import const
|
||||||
|
|
||||||
|
|
||||||
def color(color_):
|
def color(color_):
|
||||||
"""Utility for ability to disabling colored output."""
|
"""Utility for ability to disabling colored output."""
|
||||||
if settings.no_colors:
|
if settings.no_colors:
|
||||||
|
@ -12,10 +12,15 @@ def match(command):
|
|||||||
'cannot find the path' in command.output.lower(),
|
'cannot find the path' in command.output.lower(),
|
||||||
'cannot find path' in command.output.lower(),
|
'cannot find path' in command.output.lower(),
|
||||||
'can\'t cd to' in command.output.lower()
|
'can\'t cd to' in command.output.lower()
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
|
||||||
@sudo_support
|
@sudo_support
|
||||||
def get_new_command(command):
|
def get_new_command(command):
|
||||||
repl = shell.and_('mkdir -p \\1', 'chdir \\1')
|
shell_name = shell.info()
|
||||||
return re.sub(r'^chdir(.*)', repl, command.script)
|
if shell_name == 'pwsh' or shell_name == 'powershell':
|
||||||
|
new_command = ('mkdir -p \\1' + '; chdir\\1')
|
||||||
|
return re.sub(r'^chdir(.*)', new_command, command.script)
|
||||||
|
else:
|
||||||
|
repl = ('mkdir -p \\1; chdir \\1')
|
||||||
|
return re.sub(r'^chdir(.*)', repl, command.script)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user