1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 06:38:32 +00:00

Add devenv submodule

This commit is contained in:
gkodosis 2020-06-30 20:14:20 +03:00
parent fec207483d
commit 0aaf827d2d

View File

@ -0,0 +1,19 @@
from thefuck.utils import which
from subprocess import Popen, PIPE
env_available = bool(which('pyenv')) or bool(which('rbenv')) or bool(which('goenv')) or bool(which('nodenv'))
COMMON_TYPOS = {
'list': ['versions', 'install --list'],
'remove': ['uninstall'],
}
def get_commands(command):
if 'env' in command.script_parts[0]:
proc = Popen([str(command.script_parts[0]), 'commands'], stdout=PIPE)
else:
proc = Popen([str(command.script_parts[1]), 'commands'], stdout=PIPE)
return [line.decode('utf-8').strip() for line in proc.stdout.readlines()]