dotnet / install-scripts

MIT License
133 stars 72 forks source link

Add possibility to output an env. variables with installed by the script .NET product version #361

Closed IvanZosimov closed 1 year ago

IvanZosimov commented 1 year ago

Description: In the scope of this PR, the function Set-Informational-Env-Variable() / set_informational_env_variable() was added both to the powershell and bash scripts.

Notes: While the Powershell script is working perfectly, the Bash script isn't as good. Setting env. variables in the parent shell is possible only using sourcing (source or dot command) but the Bash script contains a lot of exits. As soon as the script is executed in source mode and meets the exit() command the script closes the shell. If you could give me a hint how to workaround this bash "feature", it would be really nice!

Note On the line 1753 of the original bash script I'm also seeing export statement and message above states that this export will work only with sourcing. In my case even this export it's not working. Is it a bug or I don't get it well ? 😃

Related issue: https://github.com/dotnet/install-scripts/issues/360

IvanZosimov commented 1 year ago

@dotnet-policy-service agree

IvanZosimov commented 1 year ago

A gentle ping to the maintainers of the repo 📟 @YuliiaKovalova @AR-May

AR-May commented 1 year ago

@IvanZosimov, sorry for not reviewing earlier, that's due to vacations and public holidays on the previous week. I will take a look soon this week.

AR-May commented 1 year ago

In my case even this export it's not working. Is it a bug or I don't get it well?

Yes, sounds like a bug. The exits that do not allow sourcing to work properly is not good as well. Although I doubt that we could get to it in the near future given the maintenance mode.

YuliiaKovalova commented 1 year ago

Hi @IvanZosimov,

Do you plan to finalize this PR?

IvanZosimov commented 1 year ago

Hi, @YuliiaKovalova 👋 Unfortunately, I don't. I found yet another way how to solve the issue. I'm closing this PR as well as the issue.