fix: if i18n file exist, try to replace it when init. #95
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user