diff options
author | Christian Kohlstedde <christian@kohlsted.de> | 2020-07-22 22:37:28 +0200 |
---|---|---|
committer | Christian Kohlstedde <christian@kohlsted.de> | 2020-07-22 22:57:50 +0200 |
commit | 546200bf0b250af92e893533e495254b17f40c57 (patch) | |
tree | e656e1e9559a3685f701bbaac30650cc87198333 | |
parent | a201b04125a5b7b020b9d2010f8791cc810c33bb (diff) | |
download | rofi-pass-546200bf0b250af92e893533e495254b17f40c57.tar.gz |
Fix password listing regression (#179)
-rw-r--r-- | README.md | 1 | ||||
-rwxr-xr-x | rofi-pass | 20 |
2 files changed, 9 insertions, 12 deletions
@@ -80,6 +80,7 @@ in a convenient way using [rofi](https://github.com/DaveDavenport/rofi). * xdotool * gawk * bash 4.x +* find * pwgen * [pass-otp](https://github.com/tadfisher/pass-otp) (optional: for OTPs) @@ -67,12 +67,17 @@ has_qrencode() { command -v qrencode >/dev/null 2>&1 } -# get all password files and create an array +listgpg () { + mapfile -d '' pw_list < <(find -L . -name '*.gpg' -print0) + pw_list=("${pw_list[@]#./}") + printf '%s\n' "${pw_list[@]}" | sort -n +} + +# get all password files and output as newline-delimited text list_passwords() { cd "${root}" || exit - pw_list=($(find -L * -name "*.gpg")) + mapfile -t pw_list < <(listgpg) printf '%s\n' "${pw_list[@]%.gpg}" | sort -n - } doClip () { @@ -678,11 +683,6 @@ manageEntry () { fi } -listgpg () { - pw_list=(**/*.gpg) - printf '%s\n' "${pw_list[@]}" | sort -n -} - insertPass () { url=$(xclip --selection clipboard -o) @@ -805,9 +805,6 @@ get_config_file () { } main () { - # enable extended globbing - shopt -s nullglob globstar - # load config file config_file="$(get_config_file)" [[ ! -z "$config_file" ]] && source "$config_file" @@ -881,4 +878,3 @@ main () { } main "$@" - |