-
Notifications
You must be signed in to change notification settings - Fork 38
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
Set token to empty value #24
Comments
@anangaur Any idea about this? |
@pascalberger Yes this is a bug. I will try to fix it asap. |
I tried setting an environment variable in powershell with empty value and it doesn't set that variable. I think an env variable with empty value means you are unsetting that environment variable and thus it is no longer passes the test-path env:$matchedItem check. |
@harshil93 Yes this was also my observation. Any approach how this should be solved? Would setting an empty value in case neither environment variable was set nor value was found in configuration be an option? |
@harshil93 @anangaur Any opinion about this? |
I agree with @pascalberger. If an environment variable is unset (i.e. not found in configuration) by means of assigning it to an empty string, then the replaced variable should default to an empty string. i.e in the very last |
I've created a PR for this: #48. @harshil93 @anangaur Any chance to get this merged and released? |
@pascalberger - One issue I can see with setting a not defined variable to an empty is breaking existing behavior if someone later in their tasks is doing something with unassigned variables. Given this, I think an optional checkbox option telling user to replace undefined with empty ones would be better rather than just changing the behavior. |
@harshil93 Thanks for the feedback. I'll update the PR with a user checkbox. But propably will wait until #50 is merged and rebase on this. |
@pascalberger The PR is merged. If you want to contribute to this. Go ahead. |
@harshil93 Since you have closed this issue do you already merge the PR (#48)? Otherwise the issue is not fixed... |
@pascalberger I will try to get it merged by today. Reopening the issue till it get merged. |
* Set tokens to empty values if not set. Fixes #24 * Add option for defining if empty values should be replaced.
Currently it seems to not be possible to set the value of a token in the tokenizer task to an empty value. If I have a file containing the token
__foo__
and a variable with no value set, the token is not replaced (Test-Path env:$matchedItem
returnsfalse
).It would be nice if the Tokenizer would also support to replace tokens with empty strings.
The text was updated successfully, but these errors were encountered: