From ae204b0832e72aa32fbd2f07abe284ba37169996 Mon Sep 17 00:00:00 2001 From: Tom McKeesick Date: Sat, 5 Feb 2022 00:06:48 +1100 Subject: [PATCH] Use sed instead of cut to trim indentation cut removes the \033[0m colour reset code from the file, using sed ensures that only whitespace is removed --- build/build_cows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build_cows.go b/build/build_cows.go index 18578b62..0d173285 100644 --- a/build/build_cows.go +++ b/build/build_cows.go @@ -55,7 +55,7 @@ func findFiles(dirpath string, ext string, skip []string) []string { } func img2xterm(sourceFpath string) (error, []byte) { - out, err := exec.Command("bash", "-c", fmt.Sprintf("/usr/local/bin/img2xterm %s | grep \"\\S\" | tail -n +2 | cut -c 14-", sourceFpath)).Output() + out, err := exec.Command("bash", "-c", fmt.Sprintf("/usr/local/bin/img2xterm %s | grep \"\\S\" | tail -n +2 | sed 's/^\\s\\{14\\}//g'", sourceFpath)).Output() return err, out }