From: Andrew Clarke Date: Sat, 21 Aug 2021 04:30:16 +0000 (+1000) Subject: remove carriage return from -clean prompt and fix broken logic (#2186) X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=dcf94816fbadd1c36d9a46625c92bcedcb64e56c;p=micro.git remove carriage return from -clean prompt and fix broken logic (#2186) --- diff --git a/cmd/micro/clean.go b/cmd/micro/clean.go index 6ec5455f..7dfd2c7a 100644 --- a/cmd/micro/clean.go +++ b/cmd/micro/clean.go @@ -23,12 +23,9 @@ func shouldContinue() bool { return false } - if len(text) <= 1 { - // default continue - return true - } + text = strings.TrimRight(text, "\r\n") - return strings.ToLower(text)[0] == 'y' + return len(text) == 0 || strings.ToLower(text)[0] == 'y' } // CleanConfig performs cleanup in the user's configuration directory