diff options
-rwxr-xr-x | tessen | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -68,33 +68,33 @@ get_gopass_files() { # do, we parse the list of all the files inside the dir and store them in # an associative array with the name of the files as the index and the path # as the value - if [[ $line == path* ]] && [[ -d ${line#* } ]]; then - path_files=("${line#* }"/**/*.gpg) - path_files=("${path_files[@]#"${line#* }"/}") + if [[ $line == mounts.path* ]] && [[ -d ${line#*= } ]]; then + path_files=("${line#*= }"/**/*.gpg) + path_files=("${path_files[@]#"${line#*= }"/}") path_files=("${path_files[@]%.gpg}") for file in "${path_files[@]}"; do - tmp_gopass_files["$file"]="${line#* }" + tmp_gopass_files["$file"]="${line#*= }" done fi # similarly, we go through the mount points, generate the list of files # inside those mount points, add those files to the associative array with # the file names as the index and the location of the mount point as the # value - if [[ $line == mount* ]]; then + if [[ $line == mounts.*.path* ]]; then # remove the quotes from the parsed line line="${line//\"/}" # the mount name needs to be extracted to distinguish files with # potentially identical names - mount_name="${line#mount *}" - mount_name="${mount_name% =>*}" + mount_name="${line#mounts*.}" + mount_name="${mount_name%.path*}" mount_name_arr+=("$mount_name") - if [[ -d ${line#*=> } ]]; then - path_files=("${line#*=> }"/**/*.gpg) - path_files=("${path_files[@]#"${line#*=> }"/}") + if [[ -d ${line#*= } ]]; then + path_files=("${line#*= }"/**/*.gpg) + path_files=("${path_files[@]#"${line#*= }"/}") path_files=("${path_files[@]%.gpg}") path_files=("${path_files[@]/#/"$mount_name/"}") for file in "${path_files[@]}"; do - tmp_gopass_files["$file"]="${line#*=> }" + tmp_gopass_files["$file"]="${line#*= }" done fi fi |