From de02525594ba8da860517fbf03428fc93adcce04 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 14 Dec 2017 08:37:27 -0800 Subject: [PATCH] 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 --- test/ipfs-test-lib.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/ipfs-test-lib.sh b/test/ipfs-test-lib.sh index c2e804a2b..fc856df47 100644 --- a/test/ipfs-test-lib.sh +++ b/test/ipfs-test-lib.sh @@ -1,5 +1,9 @@ # Generic test functions for go-ipfs +ansi_strip() { + sed 's/\x1b\[[0-9;]*m//g' +} + # Quote arguments for sh eval shellquote() { _space='' @@ -48,7 +52,7 @@ test_path_cmp() { # This takes a Dockerfile, and a build context directory docker_build() { - docker build --rm -f "$1" "$2" + docker build --rm -f "$1" "$2" | ansi_strip } # This takes an image as argument and writes a docker ID on stdout