strip ANSI sequences from docker build output
sharness was failing because an ANSI reset sequence was getting inserted at the beginning of the line. License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Steven Allen committed
Dec 14, 2017 at 08:37 UTC
de02525594ba8da860517fbf03428fc93adcce04
1 file changed
+5
-1
test/ipfs-test-lib.sh
+5
-1
@@ -1,5 +1,9 @@
1
# Generic test functions for go-ipfs
2
3
+ansi_strip() {
4
+ sed 's/\x1b\[[0-9;]*m//g'
5
+}
6
+
7
# Quote arguments for sh eval
8
shellquote() {
9
_space=''
@@ -48,7 +52,7 @@ test_path_cmp() {
52
53
# This takes a Dockerfile, and a build context directory
54
docker_build() {
51
- docker build --rm -f "$1" "$2"
55
+ docker build --rm -f "$1" "$2" | ansi_strip
56
}
57
58
# This takes an image as argument and writes a docker ID on stdout