Skip to content

Add VFS method to support expanding relative to absolute paths. #3

@bobbystacksmash

Description

@bobbystacksmash

Lots of methods which accept a path first test if the path is relative, and if it is, they clean it up and convert it to an abspath. This should be a standard VFS method. The pattern that's being used at the moment is something like:

if (this.vfs.PathIsRelative(filepath)) {
  filepath = path.replace(/^C:/i, "");
  // get_env("path") returns the process CWD.
  filepath = win32path.join(this.ctx.get_env("path"), filepath);
}

To find examples, search for any method calls to vfs.PathIsRelative().

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions