Skip to content

Commit 3ca4f52

Browse files
author
shenjun
committed
fixed the not finding packages bug and adjust the css for template html
1 parent e9b5682 commit 3ca4f52

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

engine/template.html.go

+1-1
Large diffs are not rendered by default.

templates/template.html

+1-1
Large diffs are not rendered by default.

utils/utils.go

+8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
"strings"
2020

2121
"github.com/golang/glog"
22+
"go/build"
23+
"fmt"
2224
)
2325

2426
var (
@@ -28,11 +30,16 @@ var (
2830
// DirList is a function that traverse the file directory containing the
2931
// specified file format according to the specified rule.
3032
func DirList(projectPath string, suffix, except string) (dirs map[string]string, err error) {
33+
var relativePath string = ""
3134
dirs = make(map[string]string, 0)
3235
_, err = os.Stat(projectPath)
3336
if err != nil {
3437
glog.Errorln("dir path is invalid")
3538
}
39+
if build.IsLocalImport(projectPath) {
40+
toPos := strings.LastIndex(projectPath, string(filepath.Separator))
41+
relativePath = projectPath[0:toPos+1]
42+
}
3643
exceptsFilter(except)
3744
err = filepath.Walk(projectPath, func(subPath string, f os.FileInfo, err error) error {
3845
if f == nil {
@@ -49,6 +56,7 @@ func DirList(projectPath string, suffix, except string) (dirs map[string]string,
4956
} else {
5057
if len(subPath) > sepIdx {
5158
dir = subPath[0:sepIdx]
59+
dir = fmt.Sprintf("%s%s", relativePath, dir)
5260
}
5361
}
5462
if ExceptPkg(dir) {

0 commit comments

Comments
 (0)