account for non-unix filepaths
This commit is contained in:
parent
5df045ca78
commit
b070ab6696
1 changed files with 2 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"oss.terrastruct.com/d2/d2ast"
|
"oss.terrastruct.com/d2/d2ast"
|
||||||
|
|
@ -21,7 +22,7 @@ func (c *compiler) pushImportStack(imp *d2ast.Import) (string, bool) {
|
||||||
impPath += ".d2"
|
impPath += ".d2"
|
||||||
}
|
}
|
||||||
|
|
||||||
if !path.IsAbs(impPath) {
|
if !filepath.IsAbs(impPath) {
|
||||||
impPath = path.Join(path.Dir(c.importStack[len(c.importStack)-1]), impPath)
|
impPath = path.Join(path.Dir(c.importStack[len(c.importStack)-1]), impPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue