Joseph Frazier
2017-03-10 15:22:48 -05:00
parent 35ea4dce71
commit 4b53b1d3e3
4 changed files with 18 additions and 3 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
import re
from thefuck.utils import for_app
from thefuck.system import open_command
@for_app('yarn', at_least=2)
@@ -8,6 +9,6 @@ def match(command):
def get_new_command(command):
fix = re.findall(r'Visit ([^ ]*) for documentation about this command.', command.stdout)[0]
url = re.findall(r'Visit ([^ ]*) for documentation about this command.', command.stdout)[0]
return 'open ' + fix
return open_command(url)
+8
View File
@@ -3,6 +3,7 @@ import sys
import tty
import termios
import colorama
from distutils.spawn import find_executable
from .. import const
init_output = colorama.init
@@ -35,6 +36,13 @@ def get_key():
return ch
def open_command(arg):
if (find_executable('xdg-open')):
return 'xdg-open ' + arg
return 'open ' + arg
try:
from pathlib import Path
except ImportError:
+5
View File
@@ -26,6 +26,11 @@ def get_key():
encoding = sys.stdout.encoding or os.environ.get('PYTHONIOENCODING', 'utf-8')
return ch.decode(encoding)
def open_command(arg):
return 'cmd /c start ' + arg
try:
from pathlib import Path
except ImportError: