From 0aaf827d2dd9b99d84f4bce4978d3b71e3b9caec Mon Sep 17 00:00:00 2001 From: gkodosis Date: Tue, 30 Jun 2020 20:14:20 +0300 Subject: [PATCH] Add devenv submodule --- thefuck/specific/devenv.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 thefuck/specific/devenv.py diff --git a/thefuck/specific/devenv.py b/thefuck/specific/devenv.py new file mode 100644 index 00000000..541d0a25 --- /dev/null +++ b/thefuck/specific/devenv.py @@ -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()]