Skip to content

Commit 70a41ef

Browse files
committed
Merge pull request #11 from holman/relative-paths
Output relative paths instead of filenames
2 parents 6d6c9e3 + 80a14e1 commit 70a41ef

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

spaceman-diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ else
5252
sizeB=0
5353
fi
5454

55-
headerA="OLD: $(basename "$1") ($sizeA KB)"
56-
headerB="NEW: $(basename "$5") ($sizeB KB)"
55+
headerA="OLD: $1 ($sizeA KB)"
56+
headerB="NEW: $5 ($sizeB KB)"
5757

5858
lengthA=$(echo $headerA | wc -m | xargs)
5959
lengthB=$(echo $headerB | wc -m | xargs)

spaceman-diff-test.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ it_renders_diff() {
2020
test/images/flag.png a190ba 100644 \
2121
test/images/gooder-flag.png 000000 100644)
2222

23-
grep -F "OLD: flag.png (84 KB)" < "$output_file"
24-
grep -F "NEW: gooder-flag.png (9 KB)" < "$output_file"
23+
grep -F "OLD: test/images/flag.png (84 KB)" < "$output_file"
24+
grep -F "NEW: test/images/gooder-flag.png (9 KB)" < "$output_file"
2525

2626
rm "$output_file"
2727
}
@@ -32,8 +32,8 @@ it_works_with_output_filenames_containing_spaces() {
3232
"test/images/flag.png" a190ba 100644 \
3333
"test/images/with spaces.png" 000000 100644)
3434

35-
grep -F 'OLD: flag.png (84 KB)' < "$output_file"
36-
grep -F 'NEW: with spaces.png (9 KB)' < "$output_file"
35+
grep -F 'OLD: test/images/flag.png (84 KB)' < "$output_file"
36+
grep -F 'NEW: test/images/with spaces.png (9 KB)' < "$output_file"
3737

3838
rm "$output_file"
3939
}
@@ -44,8 +44,8 @@ it_works_with_input_filenames_containing_spaces() {
4444
"test/images/with spaces.png" a190ba 100644 \
4545
"test/images/flag.png" 000000 100644)
4646

47-
grep -F 'OLD: with spaces.png (9 KB)' < "$output_file"
48-
grep -F 'NEW: flag.png (84 KB)' < "$output_file"
47+
grep -F 'OLD: test/images/with spaces.png (9 KB)' < "$output_file"
48+
grep -F 'NEW: test/images/flag.png (84 KB)' < "$output_file"
4949

5050
rm "$output_file"
5151
}
@@ -56,8 +56,8 @@ it_works_with_small_files() {
5656
"test/images/gooder-flag.png" a190ba 100644 \
5757
"test/images/small-image.png" 000000 100644)
5858

59-
grep -F 'OLD: gooder-flag.png (9 KB)' < "$output_file"
60-
grep -F 'NEW: small-image.png (0 KB)' < "$output_file"
59+
grep -F 'OLD: test/images/gooder-flag.png (9 KB)' < "$output_file"
60+
grep -F 'NEW: test/images/small-image.png (0 KB)' < "$output_file"
6161

6262
rm "$output_file"
6363
}

0 commit comments

Comments
 (0)