From a4a825c5f36e8c3242568aa2f518011901cc3420 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Fri, 5 Jun 2020 13:38:49 +0200 Subject: bash_completion: don't cache package list when an error occured This can happen when the user aborts with 'ctrl+c' while ptxdist is generating the package list. Signed-off-by: Michael Olbrich --- scripts/bash_completion | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts/bash_completion') diff --git a/scripts/bash_completion b/scripts/bash_completion index deb14ad0c..b41754bae 100644 --- a/scripts/bash_completion +++ b/scripts/bash_completion @@ -15,6 +15,9 @@ __ptxdist_completion_packages() { local cache="${1}/.bash_completion_packages" if [ -z "${2}" -o "${2}" -nt "${cache}" -o "${3}" -nt "${cache}" -o "${4}" -nt "${cache}" ]; then ${_ptxdist_cmd} print PTX_PACKAGES_SELECTED 2>/dev/null | tee "${cache}" 2>/dev/null + if [ ${PIPESTATUS[0]} -ne 0 -o ${PIPESTATUS[1]} -ne 0 ]; then + rm "${cache}" + fi else cat "${cache}" fi -- cgit v1.2.3