Skip to content

Commit 7c1b39e

Browse files
committed
cue: fix Windows breakage
Closes #75 cuelang/cue#75 GitOrigin-RevId: ea4d1dab20c71fc1bf66f9a6077d0e19dcd0b030 Change-Id: I70736f7d67a8b37500d618573999e2fb1caad7ea Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2960 Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent 6351fc2 commit 7c1b39e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cue/marshal.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,17 @@ func (r *Runtime) Marshal(instances ...*Instance) (b []byte, err error) {
165165
dir = i.inst.Root
166166
}
167167
if dir != "" {
168+
filename = filepath.FromSlash(filename)
168169
filename, _ = filepath.Rel(dir, filename)
169170
filename = filepath.ToSlash(filename)
170171
}
171172
}
173+
// TODO: this should probably be changed upstream, but as the path
174+
// is for reference purposes only, this is safe.
175+
importPath := filepath.ToSlash(i.ImportPath)
172176

173177
staged = append(staged, instanceData{
174-
Path: i.ImportPath,
178+
Path: importPath,
175179
Files: []fileData{{filename, b}},
176180
})
177181

0 commit comments

Comments
 (0)