I'm trying to override 'ls' command to display dotfiles in "dotfiles" directory.
Here is my code.
def _ls():
if $(pwd).rstrip(os.linesep) == $DOTFILES:
ls -Ga
else:
ls -G
aliases['ls'] = _ls
This code goes into an endless loop because _ls
function calls ls
command and it calls _ls
function.
Any ideas?