1
0
mirror of https://github.com/beego/bee.git synced 2025-07-11 08:01:01 +00:00

update swagger links

This commit is contained in:
astaxie
2016-08-17 00:52:57 +08:00
parent 525d2b0901
commit 20da95be6e
3 changed files with 54 additions and 43 deletions

21
run.go
View File

@ -120,7 +120,14 @@ func runApp(cmd *Command, args []string) int {
files = append(files, arg)
}
}
if downdoc == "true" {
if _, err := os.Stat(path.Join(currpath, "swagger", "index.html")); err != nil {
if os.IsNotExist(err) {
downloadFromURL(swaggerlink, "swagger.zip")
unzipAndDelete("swagger.zip")
}
}
}
if gendoc == "true" {
NewWatcher(paths, files, true)
Autobuild(files, true)
@ -128,14 +135,7 @@ func runApp(cmd *Command, args []string) int {
NewWatcher(paths, files, false)
Autobuild(files, false)
}
if downdoc == "true" {
if _, err := os.Stat(path.Join(currpath, "swagger")); err != nil {
if os.IsNotExist(err) {
downloadFromURL(swaggerlink, "swagger.zip")
unzipAndDelete("swagger.zip", "swagger")
}
}
}
for {
select {
case <-exit:
@ -155,6 +155,9 @@ func readAppDirectories(directory string, paths *[]string) {
if strings.HasSuffix(fileInfo.Name(), "docs") {
continue
}
if strings.HasSuffix(fileInfo.Name(), "swagger") {
continue
}
if !vendorWatch && strings.HasSuffix(fileInfo.Name(), "vendor") {
continue