Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: if i18n file exist, try to replace it when init. #95

LinkinStar18e062623e17
diff --git a/internal/cli/install.go b/internal/cli/install.go
index 1f759b7b..6737da98 100644
--- a/internal/cli/install.go
+++ b/internal/cli/install.go
@@ -2,6 +2,7 @@ package cli
import (
"fmt"
+ "os"
"path/filepath"
"github.com/answerdev/answer/configs"
@@ -96,6 +97,12 @@ func installI18nBundle() {
if err != nil {
continue
}
+ if dir.CheckFileExist(path) {
+ fmt.Printf("[i18n] install %s file exist, try to replace it\n", item.Name())
+ if err = os.Remove(path); err != nil {
+ fmt.Println(err)
+ }
+ }
fmt.Printf("[i18n] install %s bundle...\n", item.Name())
err = writer.WriteFile(path, string(content))
if err != nil {