From 9b0e826ef03b004e8a9511d0287c460c203d4d61 Mon Sep 17 00:00:00 2001 From: Jasonzyt <66063199+Jasonzyt@users.noreply.github.com> Date: Wed, 7 Feb 2024 22:28:19 +0800 Subject: [PATCH] feat: fix #2 --- main.go | 1 - utils/install.go | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 935632c..ae48f11 100644 --- a/main.go +++ b/main.go @@ -130,7 +130,6 @@ func main() { if err != nil { logger.LogError(err) // TODO: Add rollback - // TODO: Add tips for common errors(clearing cache, etc.) return } logger.LogSuccess("Install complete.") diff --git a/utils/install.go b/utils/install.go index 84e3f1f..8ba9322 100644 --- a/utils/install.go +++ b/utils/install.go @@ -124,8 +124,15 @@ Unzip: BarEnd: "]", })) - Unzip(file, bar) - logger.Log(" Unzip complete!") + err = Unzip(file, bar) + if err != nil { + if useCache { + logger.LogWarning(" Failed to unzip files. Consider clearing cache(--clear-cache) or disable cache(--no-cache) and try again.") + } + return err + } else { + logger.Log(" Unzip complete!") + } file.Close() if !useCache {