From 247225e89ed6037e6dbdf767731404eaee8834fa Mon Sep 17 00:00:00 2001 From: Logan Wright Date: Thu, 30 Mar 2017 12:19:54 +0200 Subject: [PATCH] ensure fail finishes --- Sources/Console/Bar/Bar.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/Console/Bar/Bar.swift b/Sources/Console/Bar/Bar.swift index 4fc8947a..4e548ee7 100644 --- a/Sources/Console/Bar/Bar.swift +++ b/Sources/Console/Bar/Bar.swift @@ -46,6 +46,11 @@ public class Bar { } public func fail(_ message: String? = nil) { + guard !hasFinished else { + return + } + hasFinished = true + let message = message ?? "Failed" if animated {