Make TerminalCommands alias nonexistent commands only

This commit is contained in:
Kristóf Tóth 2018-04-18 16:22:01 +02:00
parent 25d039e84e
commit c909317ca0

View File

@ -22,7 +22,7 @@ class TerminalCommands(ABC):
def _setup_bashrc_aliases(self, bashrc):
with open(bashrc, 'a') as ofile:
alias_template = 'alias {0}="{0} > /dev/null 2>&1"\n'
alias_template = 'type {0} &> /dev/null || alias {0}="{0} &> /dev/null"\n'
for command in self.command_implemetations.keys():
ofile.write(alias_template.format(command))