]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Fix "No such file or directory" on tab-completion
authorHelge <helgesdk@gmail.com>
Wed, 3 Jul 2013 20:06:51 +0000 (22:06 +0200)
committertachylatus <helgesdk@gmail.com>
Thu, 4 Jul 2013 11:36:03 +0000 (13:36 +0200)
Checks if the directory ~/.autorandr exists before searching for profiles.
Example error message:
autorandr -find: `/root/.autorandr/*': No such file or directory

bash_completion/autorandr

index b00999452fdb4d4cb1b73ebc1ece66793858cccd..151c59698807c5b7de8d2a7ebc43b5677d88ecb0 100644 (file)
@@ -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
                --*)