-
Notifications
You must be signed in to change notification settings - Fork 221
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
Allow variable substitution default value containing a colon #882
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Left a comment with my thoughts.
@@ -82,7 +82,7 @@ function evaluateSingleVariable(replace: Replace, match: string, variable: strin | |||
|
|||
// try to separate variable arguments from variable name | |||
let args: string[] = []; | |||
const parts = variable.split(':'); | |||
const parts = variable.split(':', 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would prevent us from introducing additional arguments in the future because we would break existing configs.
Also: split()
with the limit argument does not include the remaining part of the text after the limit was hit. This would need a closer look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we would need additional arguments in the future after the current ones it would be nice to be able to escape the :
in the default value. Would this be an approach to go for?
something like "WEBSITE_URL": "${localEnv:WEBSITE_URL:https\://example.com"
fix limitting parts of variable substitution
Allows to use a default value like this: