Skip to content

Commit f7c5699

Browse files
committed
- F Created approve_all.sh
1 parent 0ecf28d commit f7c5699

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

resources/approve_all.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
4+
LOGFILE="../approvaltests-tests/.approval_tests_temp/.failed_comparison.log"
5+
6+
while IFS= read -r line; do
7+
# 1) Parse the line to get source (before '->') and destination (after '->')
8+
# Using parameter expansion to split on the substring "->"
9+
src="${line%->*}"
10+
dst="${line#*->}"
11+
12+
# 2) Trim leading/trailing whitespace from src and dst
13+
# (xargs does a quick trim when there's no other transformation)
14+
src="$(echo "$src" | xargs)"
15+
dst="$(echo "$dst" | xargs)"
16+
17+
# 3) Perform the move
18+
echo "Moving '$src' to '$dst'"
19+
mv "$src" "$dst"
20+
done < "$LOGFILE"

0 commit comments

Comments
 (0)