chore(tools): Fix doc inclusion tools on Windows (#13685)
This commit is contained in:
parent
043aa0374b
commit
1f3b7e86ef
|
|
@ -91,7 +91,7 @@ func main() {
|
|||
|
||||
newUnresolved := make(map[string]string)
|
||||
for name, fn := range unresolved {
|
||||
if filepath.IsAbs(fn) {
|
||||
if strings.HasPrefix(filepath.ToSlash(fn), "/") {
|
||||
fn = filepath.Join(root, fn)
|
||||
}
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ func main() {
|
|||
pwd = string(filepath.Separator) + pwd
|
||||
for _, iname := range extractIncludes(tmpl) {
|
||||
ifn := iname
|
||||
if !filepath.IsAbs(ifn) {
|
||||
if !strings.HasPrefix(ifn, "/") {
|
||||
ifn = filepath.Join(pwd, ifn)
|
||||
}
|
||||
newUnresolved[iname] = ifn
|
||||
|
|
|
|||
|
|
@ -52,10 +52,9 @@ func extractIncludeBlock(txt []byte, includesEx *regexp.Regexp, root string) *in
|
|||
if len(inc) != 2 {
|
||||
continue
|
||||
}
|
||||
include := filepath.FromSlash(string(inc[1]))
|
||||
include := string(inc[1])
|
||||
// Make absolute paths relative to the include-root if any
|
||||
// Check original value to avoid platform specific slashes
|
||||
if filepath.IsAbs(string(inc[1])) {
|
||||
if strings.HasPrefix(include, "/") {
|
||||
if root == "" {
|
||||
log.Printf("Ignoring absolute include %q without include root...", include)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Reference in New Issue