Skip to content

Commit 04fda0b

Browse files
authored
Update ultracompare.sh
1 parent fa3025d commit 04fda0b

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Diff for: ultracompare.sh

+3-14
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,9 @@ echo "Creating diff directory from modified path..."
6262
rm -rf "$DIFF_DIR"
6363
cp -a "$MODIFIED_PATH" "$DIFF_DIR"
6464

65-
# Create diff-log.txt from modified-log.txt
66-
cp "$MODIFIED_LOG" "$DIFF_LOG"
67-
68-
# Final step: Remove all matching lines from diff-log.txt
69-
echo "Finalizing diff-log.txt by removing matches from original-log.txt..."
70-
while IFS= read -r original_line; do
71-
# Extract relative path and hash from the original log
72-
original_relative_path=$(echo "$original_line" | cut -d'|' -f1 | xargs)
73-
original_hash=$(echo "$original_line" | cut -d'|' -f2 | xargs)
74-
75-
# Create the matching pattern and remove it from diff-log.txt
76-
grep_pattern="^${original_relative_path//./\\.} | $original_hash$"
77-
sed -i "/$grep_pattern/d" "$DIFF_LOG"
78-
done <"$ORIGINAL_LOG"
65+
# Create diff-log.txt using grep -vxFf
66+
echo "Creating diff-log.txt by comparing original-log.txt and modified-log.txt..."
67+
grep -vxFf "$ORIGINAL_LOG" "$MODIFIED_LOG" > "$DIFF_LOG"
7968

8069
# Remove matching files from the diff directory
8170
echo "Removing matching files from diff directory..."

0 commit comments

Comments
 (0)