修改 文案

This commit is contained in:
dengsgo 2020-03-03 11:12:08 +08:00
parent f2afa015bd
commit f989590d14
2 changed files with 13 additions and 13 deletions

View File

@ -57,16 +57,16 @@ func parseConfig() {
cfg = new(FileGirl) cfg = new(FileGirl)
fc, err := ioutil.ReadFile(getFileGirlPath()) fc, err := ioutil.ReadFile(getFileGirlPath())
if err != nil { if err != nil {
logError("The filegirl.yaml file in", projectFolder, "is not exist! ", err) logError("the filegirl.yaml file in", projectFolder, "is not exist! ", err)
fmt.Print(firstRunHelp) fmt.Print(firstRunHelp)
logAndExit("Fileboy unable to run.") logAndExit("fileboy unable to run.")
} }
err = yaml.Unmarshal(fc, cfg) err = yaml.Unmarshal(fc, cfg)
if err != nil { if err != nil {
logAndExit("Parsed filegirl.yaml failed: ", err) logAndExit("parsed filegirl.yaml failed: ", err)
} }
if cfg.Core.Version > Version { if cfg.Core.Version > Version {
logAndExit("Current fileboy support max version : ", Version) logAndExit("current fileboy support max version : ", Version)
} }
// init map // init map
cfg.Monitor.TypesMap = map[string]bool{} cfg.Monitor.TypesMap = map[string]bool{}
@ -283,15 +283,15 @@ func parseArgs() {
case "init": case "init":
_, err := ioutil.ReadFile(getFileGirlPath()) _, err := ioutil.ReadFile(getFileGirlPath())
if err == nil { if err == nil {
logError("Profile filegirl.yaml already exists.") logError("profile filegirl.yaml already exists.")
logAndExit("If you want to regenerate filegirl.yaml, delete it first") logAndExit("delete it first when you want to regenerate filegirl.yaml")
} }
err = ioutil.WriteFile(getFileGirlPath(), []byte(exampleFileGirl), 0644) err = ioutil.WriteFile(getFileGirlPath(), []byte(exampleFileGirl), 0644)
if err != nil { if err != nil {
logError("Profile filegirl.yaml create failed! ", err) logError("profile filegirl.yaml create failed! ", err)
return return
} }
logUInfo("Profile filegirl.yaml created ok") logUInfo("profile filegirl.yaml created ok")
return return
case "exec": case "exec":
parseConfig() parseConfig()
@ -302,11 +302,11 @@ func parseArgs() {
case "help", "--help", "--h", "-h": case "help", "--help", "--h", "-h":
fmt.Print(helpStr) fmt.Print(helpStr)
default: default:
logAndExit("Unknown parameter, use 'fileboy help' to view available commands") logAndExit("unknown parameter, use 'fileboy help' to view available commands")
} }
return return
default: default:
logAndExit("Unknown parameters, use `fileboy help` show help info.") logAndExit("unknown parameters, use `fileboy help` show help info.")
} }
} }

View File

@ -33,7 +33,7 @@ func newTaskMan(delay int, callUrl string) *TaskMan {
if len(t.waitQueue) > 0 { if len(t.waitQueue) > 0 {
cf := t.waitQueue[len(t.waitQueue)-1] cf := t.waitQueue[len(t.waitQueue)-1]
if len(t.waitQueue) > 1 { if len(t.waitQueue) > 1 {
logInfo("Number of redundant tasks dropped:", len(t.waitQueue)-1) logInfo("redundant tasks dropped:", len(t.waitQueue)-1)
} }
t.waitQueue = []*changedFile{} t.waitQueue = []*changedFile{}
go t.preRun(cf) go t.preRun(cf)
@ -69,8 +69,8 @@ func (t *TaskMan) dispatcher(cf *changedFile) {
t.waitChan <- true t.waitChan <- true
return return
} }
logInfo("Waitting for the last task to finish") logInfo("waitting for the last task to finish")
logInfo("Number of waiting tasks:", len(t.waitQueue)) logInfo("waiting tasks:", len(t.waitQueue))
} else { } else {
t.preRun(cf) t.preRun(cf)
} }