little fix

This commit is contained in:
Rasmus Steinke 2015-08-20 18:07:29 +02:00
parent 46031aa052
commit 8dfb824153
2 changed files with 5 additions and 8 deletions

View File

@ -1,5 +1,5 @@
# permanently set alternative root dir
root=/home/carnager/test-store
# root=/path/to/root
# optional rofi parameters:
# keep in mind that 0.15.7 has different arguments compared to

View File

@ -30,7 +30,7 @@ if [[ -n "$2" && "$1" == "--root" ]]; then
root="${2}"
else
if [[ -n $root ]]; then
root="${basedir}"
root="${root}"
else
root="$HOME/.password-store"
fi
@ -39,14 +39,11 @@ PASSWORD_STORE_DIR="${root}"
# get all password files and create an array
list_passwords() {
if [[ -z "$root" ]]; then
passwords=( "$HOME/.password-store"/**/*.gpg )
else
passwords=( "${root}"/**/*.gpg )
fi
cd "${root}"
passwords=( **/*.gpg )
for password in "${passwords[@]}"; do
filename="${password#$root}"
filename="${password}"
filename="${filename%.gpg}"
echo "$filename"
done