1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-11-20 16:56:04 +00:00
Files
thefuck/thefuck/rules/has_exists_script.py

15 lines
299 B
Python

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