From b070ab66968b3e59f60fee3f9f583a2b3502edb5 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 23 Sep 2024 07:20:52 -0600 Subject: [PATCH] account for non-unix filepaths --- d2ir/import.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/d2ir/import.go b/d2ir/import.go index 2cde21ec8..6f593c5c7 100644 --- a/d2ir/import.go +++ b/d2ir/import.go @@ -4,6 +4,7 @@ import ( "io/fs" "os" "path" + "path/filepath" "strings" "oss.terrastruct.com/d2/d2ast" @@ -21,7 +22,7 @@ func (c *compiler) pushImportStack(imp *d2ast.Import) (string, bool) { impPath += ".d2" } - if !path.IsAbs(impPath) { + if !filepath.IsAbs(impPath) { impPath = path.Join(path.Dir(c.importStack[len(c.importStack)-1]), impPath) } }