From 5213cb13b227bcbb733bd178de3dd5f7a8a5ea17 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 6 Jan 2025 23:14:13 +0900 Subject: [PATCH] LIBMAN: searching only for linux libraries + not showing failed files if there aren't --- automation_tools/libman.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/automation_tools/libman.sh b/automation_tools/libman.sh index cf35ee74..ab891cf9 100644 --- a/automation_tools/libman.sh +++ b/automation_tools/libman.sh @@ -39,7 +39,7 @@ done copied_files=() failed_files=() -while IFS= read -r file; do +find "$1" -type f -name "*.so*" | while IFS= read -r file; do # Define destination file path dest_file="$target_dir/$(basename "$file")" @@ -65,10 +65,7 @@ while IFS= read -r file; do echo "Warning: Failed to copy $file. Skipping." failed_files+=("$file, $error_message") fi -done < <(find "$1" -type f) - -echo "Deleting the used lib directory" -rm -rf "$1" +done echo "LibMan is flying away" @@ -78,10 +75,13 @@ for file in "${copied_files[@]}"; do echo "$file" done -echo "Failed files:" -for file in "${failed_files[@]}"; do - echo "$file" -done +# Output failed files only if the list is not empty +if [ ${#failed_files[@]} -ne 0 ]; then + echo "Failed files:" + for file in "${failed_files[@]}"; do + echo "$file" + fi +fi