Merge pull request #15 from jackyzha0/draft-support

This commit is contained in:
Jacky Zhao 2022-03-15 00:52:13 -07:00 committed by GitHub
commit 4c489480bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View File

@ -46,7 +46,7 @@ type ConfigTOML struct {
func getIgnoredFiles(base string) (res map[string]struct{}) {
res = make(map[string]struct{})
source, err := ioutil.ReadFile(base + "/config.toml")
source, err := ioutil.ReadFile(filepath.FromSlash(base + "/config.toml"))
if err != nil {
return res
}

View File

@ -19,10 +19,13 @@ func walk(root, ext string, index bool, ignorePaths map[string]struct{}) (res []
m.Handle("---", front.YAMLHandler)
nPrivate := 0
err := filepath.WalkDir(root, func(s string, d fs.DirEntry, e error) error {
err := filepath.WalkDir(root, func(fp string, d fs.DirEntry, e error) error {
if e != nil {
return e
}
// path normalize fp
s := filepath.ToSlash(fp)
if _, ignored := ignorePaths[s]; ignored {
fmt.Printf("[Ignored] %s\n", d.Name())
nPrivate++
@ -78,4 +81,3 @@ func getText(dir string) string {
return string(fileBytes)
}