mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-14 06:38:32 +00:00
modified cd_mkdir.py to work with powershell on linux
This commit is contained in:
parent
e45e772ae6
commit
72d6759b26
@ -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:
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user