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>
This commit is contained in:
Steven Allen 2017-12-14 08:37:27 -08:00
parent a7acb77889
commit de02525594

View File

@ -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