diff --git a/.scripts/zeptosay.zp b/.scripts/zeptosay.zp index 9a8ffd9..ccf7c4c 100644 --- a/.scripts/zeptosay.zp +++ b/.scripts/zeptosay.zp @@ -1,12 +1,15 @@ (load "ascii.zp") +(define cowsay (import "ascii:cowsay")) (let ((trimmed (|> (delay (string:join zepto:args)) (lambda (x) (string:substitute x "\t" " ")) string->list list->vector (curry vector:reduce - (lambda (acc x) (if (eq? (vector:last acc) x) acc (++ acc x))) + (lambda (acc x) (if (and (eq? x " ") (eq? (vector:last acc) x)) + acc + (++ acc x))) {}) vector->list list->string))) - (ascii:cowsay trimmed)) + (cowsay trimmed)) ""