Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bobbystacksmash opened this issue Jul 19, 2018 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@bobbystacksmash
Copy link
Owner

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().

@bobbystacksmash bobbystacksmash added the enhancement New feature or request label Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant