fixes for filenames with spaces

quoting improvements, and
_list_all_added_files() now sets a global 'filenames' array.
pull/239/head
joshr 6 years ago
parent e515eb8f10
commit b2f00fd32c

@ -176,6 +176,7 @@ function _delete_line {
}
# this sets the global variable 'filename'
function _temporary_file {
# This function creates temporary file
# which will be removed on system exit.
@ -258,7 +259,7 @@ function _fsdb_rm_record {
local key="$1" # required
local fsdb="$2" # required
_gawk_inplace -v key="$key" "'$AWK_FSDB_RM_RECORD'" "$fsdb"
_gawk_inplace -v key="'$key'" "'$AWK_FSDB_RM_RECORD'" "$fsdb"
}
function _fsdb_clear_hashes {
@ -462,6 +463,7 @@ function _find_and_clean_formatted {
}
# this sets the global array variable 'filenames'
function _list_all_added_files {
local path_mappings
path_mappings=$(_get_secrets_dir_paths_mapping)
@ -470,9 +472,14 @@ function _list_all_added_files {
_abort "$path_mappings is missing."
fi
local filename
filenames=() # not local
while read -r line; do
_get_record_filename "$line"
filename=$(_get_record_filename "$line")
filenames+=("$filename")
done < "$path_mappings"
declare -a filenames # so caller can get list from filenames array
}

Loading…
Cancel
Save