58d5eff6d0
heroku updated its command suggestion formatting, so account for that.
For example:
$ heroku log
▸ log is not a heroku command.
▸ Perhaps you meant logs?
▸ Run heroku _ to run heroku logs.
▸ Run heroku help for a list of available commands.
$ fuck
heroku logs [enter/↑/↓/ctrl+c]
12 lines
240 B
Python
12 lines
240 B
Python
import re
|
|
from thefuck.utils import for_app
|
|
|
|
|
|
@for_app('heroku')
|
|
def match(command):
|
|
return 'Run heroku _ to run' in command.stderr
|
|
|
|
|
|
def get_new_command(command):
|
|
return re.findall('Run heroku _ to run ([^.]*)', command.stderr)[0]
|