Skip to content

Commit

Permalink
fixed the not finding packages bug and adjust the css for template html
Browse files Browse the repository at this point in the history
  • Loading branch information
shenjun committed Apr 27, 2018
1 parent e9b5682 commit 3ca4f52
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engine/template.html.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion templates/template.html

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
"strings"

"github.com/golang/glog"
"go/build"
"fmt"
)

var (
Expand All @@ -28,11 +30,16 @@ var (
// DirList is a function that traverse the file directory containing the
// specified file format according to the specified rule.
func DirList(projectPath string, suffix, except string) (dirs map[string]string, err error) {
var relativePath string = ""
dirs = make(map[string]string, 0)
_, err = os.Stat(projectPath)
if err != nil {
glog.Errorln("dir path is invalid")
}
if build.IsLocalImport(projectPath) {
toPos := strings.LastIndex(projectPath, string(filepath.Separator))
relativePath = projectPath[0:toPos+1]
}
exceptsFilter(except)
err = filepath.Walk(projectPath, func(subPath string, f os.FileInfo, err error) error {
if f == nil {
Expand All @@ -49,6 +56,7 @@ func DirList(projectPath string, suffix, except string) (dirs map[string]string,
} else {
if len(subPath) > sepIdx {
dir = subPath[0:sepIdx]
dir = fmt.Sprintf("%s%s", relativePath, dir)
}
}
if ExceptPkg(dir) {
Expand Down

0 comments on commit 3ca4f52

Please sign in to comment.