1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-28 05:28:38 +00:00
thefuck/thefuck/rules/mkdir_p.py

14 lines
307 B
Python

import re
from thefuck.specific.sudo import sudo_support
@sudo_support
def match(command):
return ('mkdir' in command.script
and 'No such file or directory' in command.stderr)
@sudo_support
def get_new_command(command):
return re.sub('\\bmkdir (.*)', 'mkdir -p \\1', command.script)