From: Helge Date: Wed, 3 Jul 2013 20:06:51 +0000 (+0200) Subject: Fix "No such file or directory" on tab-completion X-Git-Tag: 1.0~158 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1ea13e42716c5ee80399a898c25fb23b2e5ae46a;p=deb_pkgs%2Fautorandr.git Fix "No such file or directory" on tab-completion Checks if the directory ~/.autorandr exists before searching for profiles. Example error message: autorandr -find: `/root/.autorandr/*': No such file or directory --- diff --git a/bash_completion/autorandr b/bash_completion/autorandr index b009994..151c596 100644 --- a/bash_completion/autorandr +++ b/bash_completion/autorandr @@ -10,7 +10,11 @@ _autorandr () opts="-h -c -s -l -d" lopts="--help --change --save --load --default --force --fingerprint" - prfls="`find ~/.autorandr/* -maxdepth 1 -type d -printf '%f\n'`" + if [ -d ~/.autorandr ]; then + prfls="`find ~/.autorandr/* -maxdepth 1 -type d -printf '%f\n'`" + else + prfls="" + fi case "${cur}" in --*)