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

Support conventional var escaping #12

Open
alexey-vostrikov opened this issue Feb 12, 2024 · 1 comment
Open

Support conventional var escaping #12

alexey-vostrikov opened this issue Feb 12, 2024 · 1 comment

Comments

@alexey-vostrikov
Copy link

alexey-vostrikov commented Feb 12, 2024

Such as: single quotation, and backlsash behind dollar sign
i.e. '${VAR}' or \${VAR} sould not be substituted

@icy
Copy link
Owner

icy commented Feb 13, 2024

Hi @alexey-vostrikov,

Such as: single quotation, and backlsash behind dollar sign i.e. '${VAR}' or ${VAR} sould not be substituted

Thanks for your suggestion. This feature requires to look into the context of the variable, that means to have some custom lexer/parser like this https://github.com/a8m/envsubst/tree/master/parse . When some escape form is supported, it would need more than that, e.g., $$${VAR}, $$$${VAR},..

Though this is quite possible to have new feature, I'd rather keep my tool simple (without a huge refactoring): It simply deals with normal regular expression search-replace task. One simple thing I can do is to add a limited-context form, ie, ${{VAR}}, but this would make the use a tool lock-in.

If you know how this is done with a minimal effort, I'm more than happy to hear from you.

I have a few todos relevant to your request

  • Update README with new section How it works
  • Consider to add new form ${{VAR}} (which becomes ${VAR}) or similar simple form.

Thanks a lot.

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

No branches or pull requests

2 participants