-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
LOGFILE="../approvaltests-tests/.approval_tests_temp/.failed_comparison.log" | ||
|
||
while IFS= read -r line; do | ||
# 1) Parse the line to get source (before '->') and destination (after '->') | ||
# Using parameter expansion to split on the substring "->" | ||
src="${line%->*}" | ||
dst="${line#*->}" | ||
|
||
# 2) Trim leading/trailing whitespace from src and dst | ||
# (xargs does a quick trim when there's no other transformation) | ||
src="$(echo "$src" | xargs)" | ||
dst="$(echo "$dst" | xargs)" | ||
|
||
# 3) Perform the move | ||
echo "Moving '$src' to '$dst'" | ||
mv "$src" "$dst" | ||
done < "$LOGFILE" |