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

Make absolute paths relative to main script. #1026

Closed
ArjanvHugten opened this issue May 20, 2019 · 3 comments
Closed

Make absolute paths relative to main script. #1026

ArjanvHugten opened this issue May 20, 2019 · 3 comments
Labels
enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 js-compat

Comments

@ArjanvHugten
Copy link

Might be an idea to make the absolute paths in the script relative to the main script instead of pointing to the root directory. This can be backward incompatible.

@mstoykov mstoykov added enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 question labels May 20, 2019
@na-- na-- added js-compat and removed question labels May 21, 2019
@paralectvkomodey
Copy link

Hi!

Is there any progress on this?

@mstoykov
Copy link
Contributor

There has been zero work on this ... as I don't know how to make this backward compatible. As the person who has probably fixed most bugs in that area and the random amount of problems that exist there (mostly Windows centered 🤦 ), I do think that this was probably what should've been done from the beginning. But given that this hasn't been done, and ... my work on fixing issues has shown that people do use absolute paths (again 🤦 ) I don't think it's likely we are just going to break it.

@na--
Copy link
Member

na-- commented Jan 26, 2021

I agree with @mstoykov, unfortunately there's no way to implement something like this without it being a major breaking change. As a compromise, we'll likely implement functions that return the CWD and path to the executed script file: #1320 (comment). Please follow that issue for updates, since using those proposed functions and k6's require(), it should be possible to have helpers that treat absolute paths as relative from the script.

@na-- na-- closed this as completed Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 js-compat
Projects
None yet
Development

No branches or pull requests

4 participants