From 3190da65f8bbaebccbfc3f2be713b785e73094aa Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 24 Oct 2016 11:40:12 +0200 Subject: [PATCH] bash: do not print error if checkout dir doesn't exist Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1387860 Signed-off-by: Giuseppe Scrivano Closes: #722 Approved by: rhatdan --- bash/atomic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bash/atomic b/bash/atomic index 94421e5..6923979 100644 --- a/bash/atomic +++ b/bash/atomic @@ -105,7 +105,8 @@ __atomic_system_containers_images() { __atomic_system_containers_containers() { local containers CHECKOUT_DIR=`test -e /etc/atomic.conf && grep "^checkout_path:" /etc/atomic.conf | cut -d' ' -f2` - containers="$(ls -1 ${CHECKOUT_DIR:-/var/lib/containers/atomic/} | grep -v \.[01]$)" + CHECKOUT_DIR=${CHECKOUT_DIR:-/var/lib/containers/atomic/} + test -e ${CHECKOUT_DIR} && containers="$(ls -1 ${CHECKOUT_DIR} | grep -v \.[01]$)" || containers="" COMPREPLY+=( $(compgen -W "$containers" -- "$cur") ) }