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

Feature predefined and environment variables in config #655

Conversation

DoItWithASmile
Copy link
Contributor

adds support for:

  • windows & linux environment variables in configPath, like %ENV_VAR%, ${ENV_VAR} and $ENV_VAR
  • vscode predefined variable ${workspaceFolder}

in setting "configPath"

fixes #625

Adds support for predefined VS Code variable "${workspaceFolder}" to setting "configPath" in MPE.

This allows for configuring MPE per-workspace if needed.

fixes shd101wyy#625
setting "configPath" does not support environment variables.

Extended to support windows style %ENV_VAR% as well as bash style ${ENV_VAR} and $ENV_VAR environment variables

fixes shd101wyy#625
Implementation only applies to configPath and polutes the code.

Refactors that code and extracts it into a PathResolver class.

fixes shd101wyy#625
Copy link
Owner

@shd101wyy shd101wyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I approved it.
If I remember correctly there will be some issue if we use env variables but I don't recall what the issue is. So I will just approve it for now.
It would be great if the function names could be camel case. But it's okay for now 👍
I will merge your pull request 👍

@shd101wyy shd101wyy merged commit 2f71342 into shd101wyy:master Dec 31, 2022
@DoItWithASmile
Copy link
Contributor Author

If I remember correctly there will be some issue if we use env variables but I don't recall what the issue is.

From what I can see:
predefined variables - like workspaceFolder - isn't available if there isn't an open workspace...

possible solution: ignore any set configPath in this case and revert to default. Upon change of circumstances - e.g. loading of workspace - reiterate configuration steps.

It would be great if the function names could be camel case.

oh damn... was working on another project in parallel. Must have used the naming convention from that project instead. 😒

Will correct it next time around. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't work to expand variables or ~ in configPath
2 participants