summaryrefslogtreecommitdiffhomepage
path: root/data/compare.sh
blob: 4c3958c1078839de10625f5e49651b267e1fcfb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# Run to compare all files from one pack to equivalent files from the other pack. For example:
#
#     $ ./compare.sh content
#
# Compares all files in 'content/' pack to equivalent files in 'shatter/' (default second argument).

test -z "$1" && { echo "missing directory path argument" >&2; exit 1; }
test -d "$1" || { echo "not a directory: $1" >&2; exit 1; }
left=$1
right=${2:-shatter}
for file in $(find $left/* -type f); do
	file=${file#*/}
	echo -e "\e[1mdiff $left/$file $right/$file\e[0m"
	echo -e "\e[1m<<< $left/$file\e[0m"
	if test -f "$right/$file"; then
		echo -e "\e[1m>>> $right/$file\e[0m"
		if diff --color=always $left/$file $right/$file; then
			echo Files are the same
		fi
	else
		echo -e "\e[1m>>> /dev/null\e[0m"
	fi
	echo
done