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
RefreshEnv.sh #1851
Comments
Somewhat aside, there is a https://github.com/muntaserq/refreshenv for ruby processes, and saltstack/salt#9876 (comment) looks like it doesnt need much alteration to be a refreshenv for any python process. Probably would be useful to have implementations for various runtimes available as choco packages. |
I have a half reasonable solution piggy-backing on gen_refreshenv.ps1 Import-Module C:\ProgramData\chocolatey\helpers\chocolateyProfile.psm1
Update-SessionEnvironment
# Round brackets in variable names cause problems with bash
# msys bash requires ':' instead of ';' for PATH, PWD, OLDPWD and a few others.
Get-ChildItem env:* | %{
if (!($_.Name.Contains('('))) {
$value = $_.Value
if ($_.Name -eq 'PATH') {
$value = $value -replace ';',':'
}
Write-Output ("export " + $_.Name + "='" + $value + "'")
}
} | Out-File -Encoding ascii C:\TEMP\refreshenv.sh Then Obviously not polished as it needs unique filenames for the temp file, and needs to be all done in a bash function with as few extra dependencies as possible. Also need to change the encoding, and test it with environment variable names and values which contain unicode, to determine what are the limitations there. Just using Ideally the logic in the above script could be put into a helper like |
https://gist.github.com/jayvdb/1daf8c60e20d64024f51ec333f5ce806 - unicode is replaced with ?, but otherwise works reasonably well on the travis win32 worker. |
Any viable solution so far? |
Related to #1699 |
choco is provided as part of the Travis CI Windows environment https://docs.travis-ci.com/user/reference/windows/ , and
SHELL=/usr/bin/bash
, anduname -a
isMSYS_NT-10.0 2.10.0(0.325/5/3) 2018-07-25 13:06 x86_64 Msys
, and comes from choco packagegit.install
which is https://gitforwindows.org/.A solution similar to RefreshEnv.cmd is needed for the shell. i.e. the user would need to do
source refreshenv.sh
, and maybe an alias could be created so thatrefreshenv
issource refreshenv.sh
The text was updated successfully, but these errors were encountered: