mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-23 02:41:55 +00:00
Make TerminalCommands alias nonexistent commands only
This commit is contained in:
parent
25d039e84e
commit
c909317ca0
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user