Skip to content

Commit

Permalink
refactor: 删除无用的代码
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Sep 11, 2023
1 parent 8743e0d commit 4230548
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions locales/zh-CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ messages:
- key: 输出文件为:%s
message:
msg: 输出文件为:%s
- key: 重启失败:%v
- key: 重启失败:%s
message:
msg: 重启失败:%v
msg: 重启失败:%s
4 changes: 2 additions & 2 deletions locales/zh-TW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ messages:
- key: 输出文件为:%s
message:
msg: 输出文件为:%s
- key: 重启失败:%v
- key: 重启失败:%s
message:
msg: 重啟失敗:%v
msg: 重啟失敗:%s
5 changes: 1 addition & 4 deletions watch/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package watch

import (
"fmt"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -95,8 +94,6 @@ func (b *builder) build() {

b.systemLog(Info, localeutil.StringPhrase("编译代码..."))

fmt.Println(b.goArgs)

b.goCmd = exec.Command("go", b.goArgs...)
b.goCmd.Stderr = asWriter(Go, Error, b.logs)
b.goCmd.Stdout = asWriter(Go, Info, b.logs)
Expand Down Expand Up @@ -132,7 +129,7 @@ func (b *builder) killGo() {
func (b *builder) restartApp() {
defer func() {
if err := recover(); err != nil {
b.systemLog(Error, localeutil.Phrase("重启失败:%v", err))
b.systemLog(Error, localeutil.Phrase("重启失败:%s", err))
}
}()

Expand Down
1 change: 1 addition & 0 deletions watch/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (c *consoleLogger) Output(source string, t int8, msg string) {
if s, found := c.sources[source]; found {
source = s
}
source = "[" + source + "] "

colors.Fprint(c.out, colors.Normal, c.colors[t], colors.Default, source)
msg = strings.TrimRight(msg, "\n")
Expand Down

0 comments on commit 4230548

Please sign in to comment.