From 527bb3b3ac2186c4a1181c41d53fd7bef7693d66 Mon Sep 17 00:00:00 2001 From: Christian Kohlstedde Date: Wed, 22 Jul 2020 22:43:56 +0200 Subject: Fix shellcheck warnings --- rofi-pass | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rofi-pass b/rofi-pass index 96a3072..22667e2 100755 --- a/rofi-pass +++ b/rofi-pass @@ -436,7 +436,7 @@ mainMenu () { if [[ -z "${stuff["${USERNAME_field}"]}" ]]; then if [[ -n $default_user ]]; then if [[ "$default_user" == ":filename" ]]; then - stuff["${USERNAME_field}"]="$(basename $selected_password)" + stuff["${USERNAME_field}"]="$(basename "$selected_password")" else stuff["${USERNAME_field}"]="${default_user}" fi @@ -796,8 +796,8 @@ get_config_file () { # return the first config file with a valid path for config in "${configs[@]}"; do - # '! -z' is needed in case ROFI_PASS_CONFIG is not set - if [[ ! -z "${config}" && -f "${config}" ]]; then + # '-n' is needed in case ROFI_PASS_CONFIG is not set + if [[ -n "${config}" && -f "${config}" ]]; then printf "%s" "$config" return fi @@ -807,7 +807,7 @@ get_config_file () { main () { # load config file config_file="$(get_config_file)" - [[ ! -z "$config_file" ]] && source "$config_file" + [[ -n "$config_file" ]] && source "$config_file" # create tmp dir if [[ ! -d "$cache_dir/rofi-pass" ]]; then -- cgit