1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-20 09:39:01 +00:00

Merge remote-tracking branch 'origin/cd_rules' into cd_rules

# Conflicts:
#	thefuck/rules/chdir.py
This commit is contained in:
ICalhoun 2021-05-07 16:22:12 -04:00
commit d2dabfde47

View File

@ -17,5 +17,10 @@ def match(command):
@sudo_support
def get_new_command(command):
repl = 'mkdir -p \\1; chdir \\1'
shell_name = shell.info()
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)