Compiler normalizes paths before passing them to an fs
This commit is contained in:
parent
e805060370
commit
4e6103418c
|
@ -106,9 +106,8 @@ func (resolver *Resolver) ResolveCwd (address entity.Address) (string, error) {
|
|||
|
||||
// openAbsolute exists because fs.FS implementations do not understand absolute
|
||||
// paths, which the FSPL compiler runs on. It converts an absolute path to a
|
||||
// path relative to "/" and opens the file.
|
||||
// slash path relative to "/" and opens the file.
|
||||
func openAbsolute (filesystem fs.FS, path string) (fs.File, error) {
|
||||
path, err := filepath.Rel("/", path)
|
||||
if err != nil { return nil, err }
|
||||
path = strings.TrimPrefix(filepath.ToSlash(path), "/")
|
||||
return filesystem.Open(path)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue