1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-26 20:48:47 +00:00
thefuck/thefuck/rules/heroku_not_command.py
Joseph Frazier d41cbb6810 Fix heroku_not_command for new stderr format
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]
2017-03-28 18:31:01 +02:00

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]