From 22f4c920226e4a2427262bbdc5a6dc8f9ab3753a Mon Sep 17 00:00:00 2001 From: astaxie Date: Thu, 19 Jun 2014 21:19:23 +0800 Subject: [PATCH] add tips where not exist the swagger files --- rundocs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rundocs.go b/rundocs.go index 7308ad9..ae1442d 100644 --- a/rundocs.go +++ b/rundocs.go @@ -68,6 +68,10 @@ func runDocs(cmd *Command, args []string) { if docport == "" { docport = "8089" } + if _, err := os.Stat("swagger"); err != nil && os.IsNotExist(err) { + fmt.Println("there's no swagger, please use bee rundocs -isDownload=true downlaod first") + os.Exit(2) + } fmt.Println("start the docs server on: http://127.0.0.1:" + docport) log.Fatal(http.ListenAndServe(":"+string(docport), http.FileServer(http.Dir("swagger")))) }