1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-04-15 07:10:52 +01:00
thefuck/thefuck/rules/has_exists_script.py
2015-10-29 00:13:59 +08:00

14 lines
309 B
Python

import os
from thefuck.specific.sudo import sudo_support
@sudo_support
def match(command):
return command.script_parts and os.path.exists(command.script_parts[0]) \
and 'command not found' in command.stderr
@sudo_support
def get_new_command(command):
return u'./{}'.format(command.script)