From 3c2b6e29ea592f1dcc3f1e3fc338f58f8bc6359c Mon Sep 17 00:00:00 2001 From: Michal Bocek Date: Fri, 4 Jul 2025 21:41:35 +0200 Subject: [PATCH] inspector completion: fix inaccessible db silent err Before, running `leapp-inspector --db ~/Downloads/leapp.db actors --actor` and pressing Tab did not do anything. It was because the bash completion script exited silently when it concluded that the ~/Downloads/leapp.db is inaccessible. With this fix one gets this error instead: ``` OSError: The ~/Downloads/leapp.db file doesn't exist. Specify the correct path to the leapp database file. ``` With that the user gets a hint that they need to pass a path like /home/user/Downloads/leapp.db to get the completion working. Assisted-by: Cursor AI with Claude Sonnet 4 --- scripts/leappinspector/completion/leapp-inspector.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/leappinspector/completion/leapp-inspector.bash b/scripts/leappinspector/completion/leapp-inspector.bash index 9b73e76..4b051e0 100644 --- a/scripts/leappinspector/completion/leapp-inspector.bash +++ b/scripts/leappinspector/completion/leapp-inspector.bash @@ -17,7 +17,7 @@ _get_dbfile() { local use_next=0 for word in "${COMP_WORDS[@]}"; do if [[ "$use_next" == "1" ]]; then - [[ -e "$word" ]] || return 1 + # Check if file exists, but still return the path echo "$word" return 0 fi @@ -40,7 +40,7 @@ _get_context() { local use_next=0 for word in "${COMP_WORDS[@]}"; do if [[ "$use_next" == "1" ]]; then - [[ -e "$word" ]] || return 1 + # Check if file exists, but still return the path echo "$word" return 0 fi