Skip to content
This repository has been archived by the owner on Jun 1, 2020. It is now read-only.

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
lightbrotherV committed Jan 3, 2019
1 parent 1e6e489 commit 27eded2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/BackupPlugin/BackupPlugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ func (bp *BackupPlugin) Handle(c *command.Command, s lib.Server) {
}
case "show":
backupfiles, _ := filepath.Glob("back-up/*")
//标记是否启动
for k, _ := range backupfiles {
var split string
if runtime.GOOS == "windows" {
split = "\\"
} else {
split = "/"
}
backupfiles[k] = strings.Split(backupfiles[k], split)[1]
}
text := "备份如下:\\n" + strings.Join(backupfiles, "\\n")
s.Tell(c.Player, text)
default:
Expand Down

0 comments on commit 27eded2

Please sign in to comment.