Skip to content

Commit

Permalink
- F Created approve_all.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottBob committed Jan 9, 2025
1 parent 0ecf28d commit f7c5699
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions resources/approve_all.sh
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"

0 comments on commit f7c5699

Please sign in to comment.