Giter Club home page Giter Club logo

Comments (12)

pascalberger avatar pascalberger commented on July 17, 2024

@anangaur Any idea about this?

from extension-utilitiespack.

harshil93 avatar harshil93 commented on July 17, 2024

@pascalberger Yes this is a bug. I will try to fix it asap.

from extension-utilitiespack.

harshil93 avatar harshil93 commented on July 17, 2024

I tried setting an environment variable in powershell with empty value and it doesn't set that variable.
[Environment]::SetEnvironmentVariable("TestVariable", "", "User") (This doesn't set the env 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.

from extension-utilitiespack.

pascalberger avatar pascalberger commented on July 17, 2024

@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?

from extension-utilitiespack.

pascalberger avatar pascalberger commented on July 17, 2024

@harshil93 @anangaur Any opinion about this?

from extension-utilitiespack.

MarcelMichau avatar MarcelMichau commented on July 17, 2024

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 else block of the tokenise.ps1 script:
Write-Host "No value found for token '$match' - setting to empty string"
$variableValue = [string]::Empty
works fine for me at the moment.

from extension-utilitiespack.

pascalberger avatar pascalberger commented on July 17, 2024

I've created a PR for this: #48. @harshil93 @anangaur Any chance to get this merged and released?

from extension-utilitiespack.

harshil93 avatar harshil93 commented on July 17, 2024

@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.

from extension-utilitiespack.

pascalberger avatar pascalberger commented on July 17, 2024

@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.

from extension-utilitiespack.

harshil93 avatar harshil93 commented on July 17, 2024

@pascalberger The PR is merged. If you want to contribute to this. Go ahead.

from extension-utilitiespack.

pascalberger avatar pascalberger commented on July 17, 2024

@harshil93 Since you have closed this issue do you already merge the PR (#48)? Otherwise the issue is not fixed...

from extension-utilitiespack.

harshil93 avatar harshil93 commented on July 17, 2024

@pascalberger I will try to get it merged by today. Reopening the issue till it get merged.

from extension-utilitiespack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.