Skip to content

Commit c39da78

Browse files
authored
Merge pull request #299 from JimAmuro/patch-1
fix #298
2 parents fce1135 + 5c4447a commit c39da78

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

GitUtils.ps1

+7-2
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,15 @@ function setenv($key, $value) {
228228
}
229229

230230
function Get-TempEnv($key) {
231-
$path = Join-Path ($Env:TEMP) ".ssh\$key.env"
231+
$path = Get-TempEnvPath($key)
232232
if (Test-Path $path) {
233233
$value = Get-Content $path
234234
[void][Environment]::SetEnvironmentVariable($key, $value, [EnvironmentVariableTarget]::Process)
235235
}
236236
}
237237

238238
function Set-TempEnv($key, $value) {
239-
$path = Join-Path ($Env:TEMP) ".ssh\$key.env"
239+
$path = Get-TempEnvPath($key)
240240
if ($value -eq $null) {
241241
if (Test-Path $path) {
242242
Remove-Item $path
@@ -247,6 +247,11 @@ function Set-TempEnv($key, $value) {
247247
}
248248
}
249249

250+
function Get-TempEnvPath($key){
251+
$path = Join-Path ([System.IO.Path]::GetTempPath()) ".ssh\$key.env"
252+
return $path
253+
}
254+
250255
# Retrieve the current SSH agent PID (or zero). Can be used to determine if there
251256
# is a running agent.
252257
function Get-SshAgent() {

0 commit comments

Comments
 (0)