Browse Source

Windows Compatability (#15)

path module doesn't support windows paths

path.Dir('path\to\doc.md') returns "" instead of "path\to"
this causes a valid link to 'img.png' in this document to be reported as invalid, since later on we os.stat("img.png") when it should be os.stat("path\to\img.png")
renovate/configure
Carl Johnson 7 years ago
committed by Yota Toyama
parent
commit
3b20c094c5
  1. 3
      url_checker.go

3
url_checker.go

@ -5,6 +5,7 @@ import (
"net/url" "net/url"
"os" "os"
"path" "path"
"path/filepath"
"regexp" "regexp"
"sync" "sync"
"time" "time"
@ -78,7 +79,7 @@ func (c urlChecker) resolveURL(u string, f string) (string, bool, error) {
} }
if !path.IsAbs(uu.Path) { if !path.IsAbs(uu.Path) {
return path.Join(path.Dir(f), uu.Path), true, nil return path.Join(filepath.Dir(f), uu.Path), true, nil
} }
if c.documentRoot == "" { if c.documentRoot == "" {

Loading…
Cancel
Save