Skip to content

Commit

Permalink
runners: fix if_error_find_files_sdcard if looking for full paths (…
Browse files Browse the repository at this point in the history
…shows DKMS log correctly)

- this should make `dmks`'s `make.log` properly show up in error logs now
  • Loading branch information
rpardini authored and igorpecovnik committed Jan 4, 2025
1 parent a408e0c commit 43ee737
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/functions/logging/runners.sh
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,14 @@ function logging_enrich_run_command_error_info() {
for path in "${if_error_find_files_sdcard[@]}"; do
display_alert "Searching for if_error_find_files_sdcard files" "${SDCARD}/${path}" "debug"
declare -a sdcard_files
# shellcheck disable=SC2086 # I wanna expand, thank you...
mapfile -t sdcard_files < <(find ${SDCARD}/ -type f -name "${path}")
display_alert "Found if_error_find_files_sdcard files" "${sdcard_files[@]}" "debug"
if [[ "${path}" == /* ]]; then # if path begins with a slash, we need to use path-matching and prepend an "*" asterisk.
mapfile -t sdcard_files < <(find "${SDCARD}" -type f -path "*${path}")
else # if path does not begin with a slash, we need to use name-matching.
mapfile -t sdcard_files < <(find "${SDCARD}" -type f -name "${path}")
fi
declare -i num_files_found=0
num_files_found="${#sdcard_files[@]}"
display_alert "Found if_error_find_files_sdcard files" "${num_files_found} files: ${sdcard_files[*]}" "err"
found_files+=("${sdcard_files[@]}") # add to result
done

Expand Down

0 comments on commit 43ee737

Please sign in to comment.