From b9e2a38f82368c0203adec9bcafdd8b8b059c3b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Mon, 21 Oct 2024 03:56:52 +0900 Subject: [PATCH] fix: do not throw error when file already exists --- cmd/um/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/um/main.go b/cmd/um/main.go index 6707786..04774e9 100644 --- a/cmd/um/main.go +++ b/cmd/um/main.go @@ -371,7 +371,8 @@ func (p *processor) process(inputFile string, allDec []common.NewDecoderFunc) er if !p.overwriteOutput { _, err := os.Stat(outPath) if err == nil { - return fmt.Errorf("output file %s is already exist", outPath) + logger.Warn("output file already exist, skip", zap.String("destination", outPath)) + return nil } else if !errors.Is(err, os.ErrNotExist) { return fmt.Errorf("stat output file failed: %w", err) }