-
-
Notifications
You must be signed in to change notification settings - Fork 4
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 functions to Variable related to variable substitution #27
Labels
Comments
A new |
rcjsuen
added a commit
that referenced
this issue
May 24, 2018
If the modifier is the ':' character, the substition value would incorrectly also have ':' as its prefix. The substition value should not be including the modifier character in its string. Signed-off-by: Remy Suen <remy.suen@gmail.com>
rcjsuen
added a commit
that referenced
this issue
May 24, 2018
In the exceptional cases of ${:} or ${variable:}, getModifier() will return the empty string "" instead of "}". The "}" is used to mark the end of the variable so it should be interpreted in that way instead. Signed-off-by: Remy Suen <remy.suen@gmail.com>
rcjsuen
added a commit
that referenced
this issue
May 24, 2018
Changed Variable's getSubstitutionValue() to return the empty string in the case where a modifier character has been defined but it is immediately followed by a bracket such as ${variable:+}. In cases where no modifier character has been defined such as $variable, ${variable}, or ${variable:}, null will be returned instead. This should hopefully make the function a little more predictable and easier to use. Signed-off-by: Remy Suen <remy.suen@gmail.com>
rcjsuen
added a commit
that referenced
this issue
May 25, 2018
Variable's getSubstitutionValue() gives the impression that the resolved value will be returned when it is merely returning the raw string. The function has been renamed to getSubstitutionParameter() to hopefully not mislead anyone calling this API. Signed-off-by: Remy Suen <remy.suen@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the moment,
Variable
is defined like so...It has no functions for:
replaced
) for${var:+replaced}
and${var:-replaced}
+
, a-
, or it is an invalid value (any character other than a+
or a-
cannot follow the:
and is considered to be invalid, see Warn if variable substitution does not have a valid modifier dockerfile-utils#38)The text was updated successfully, but these errors were encountered: