mirror of https://gitee.com/answerdev/answer.git
Merge branch 'fix/0.5.0/i18n-init' into 'test'
fix: if i18n file exist, try to replace it when init. #95 See merge request opensource/answer!276
This commit is contained in:
commit
fe5101b502
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue