Skip to content

Commit

Permalink
Merge pull request #299 from JimAmuro/patch-1
Browse files Browse the repository at this point in the history
fix #298
  • Loading branch information
dahlbyk committed Aug 14, 2016
2 parents fce1135 + 5c4447a commit c39da78
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions GitUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,15 @@ function setenv($key, $value) {
}

function Get-TempEnv($key) {
$path = Join-Path ($Env:TEMP) ".ssh\$key.env"
$path = Get-TempEnvPath($key)
if (Test-Path $path) {
$value = Get-Content $path
[void][Environment]::SetEnvironmentVariable($key, $value, [EnvironmentVariableTarget]::Process)
}
}

function Set-TempEnv($key, $value) {
$path = Join-Path ($Env:TEMP) ".ssh\$key.env"
$path = Get-TempEnvPath($key)
if ($value -eq $null) {
if (Test-Path $path) {
Remove-Item $path
Expand All @@ -247,6 +247,11 @@ function Set-TempEnv($key, $value) {
}
}

function Get-TempEnvPath($key){
$path = Join-Path ([System.IO.Path]::GetTempPath()) ".ssh\$key.env"
return $path
}

# Retrieve the current SSH agent PID (or zero). Can be used to determine if there
# is a running agent.
function Get-SshAgent() {
Expand Down

0 comments on commit c39da78

Please sign in to comment.