diff --git a/doc/github.go b/doc/github.go index e14854e2c..f4da49095 100644 --- a/doc/github.go +++ b/doc/github.go @@ -106,7 +106,10 @@ func GetGithubDoc(client *http.Client, match map[string]string, commit string, i // Check if it is directory or not. if strings.HasSuffix(absPath, "/") { // Directory. - dirs = append(dirs, absPath) + // Check if current directory is example. + if !(!isDownloadEx && strings.Contains(absPath, "example")) { + dirs = append(dirs, absPath) + } continue } @@ -143,11 +146,6 @@ func GetGithubDoc(client *http.Client, match map[string]string, commit string, i // Check if need to check imports. if isCheckImport { for _, d := range dirs { - // Check if current directory is example. - if !isDownloadEx && strings.Contains(d, "example") { - continue - } - dir, err := os.Open(d) if err != nil { return nil, nil, err diff --git a/gpm.go b/gpm.go index 0020e9ad7..1d21a97d1 100644 --- a/gpm.go +++ b/gpm.go @@ -159,8 +159,8 @@ func initialize() bool { } // Create bundle and snapshot directories. - os.MkdirAll(appPath+"bundles", os.ModePerm) - os.MkdirAll(appPath+"snapshots", os.ModePerm) + os.MkdirAll(appPath+"repo/bundles/", os.ModePerm) + os.MkdirAll(appPath+"repo/snapshots/", os.ModePerm) return true }