增加 首次运行提示

This commit is contained in:
dengsgo 2018-09-10 18:00:28 +08:00
parent 0cbe70408d
commit 61cf37763e
2 changed files with 12 additions and 0 deletions

View File

@ -195,6 +195,13 @@ func initWatcher() {
func parseArgs() { func parseArgs() {
l := len(os.Args) l := len(os.Args)
if l == 1 { if l == 1 {
_, err := ioutil.ReadFile(projectFolder + "/filegirl.yaml")
if err != nil {
log.Println("the filegirl.yaml file is not exist! ", err)
fmt.Print(firstRunHelp)
fmt.Print(helpStr)
return
}
initWatcher() initWatcher()
return return
} }

5
raw.go
View File

@ -39,6 +39,11 @@ command:
- go env - go env
` `
var firstRunHelp = `第一次运行 fileboy ?
你可能需要先执行 fileboy init 生成配置
更多信息查看帮助:
`
var helpStr = `fileboy [option] var helpStr = `fileboy [option]
Usage of fileboy: Usage of fileboy:
无参数 无参数