RamblingCookieMonster / PSDepend

PowerShell Dependency Handler
MIT License
285 stars 76 forks source link

Git script error with relative path #56

Closed gaelcolas closed 6 years ago

gaelcolas commented 6 years ago

When using relative path it errors just before attempting the git checkout $version, because the Set-Location l169 has already been called line 131 using a relative path.

The fix seems to be to resolve the Full path of $target initially, line 90.

$GitName = $Name.trimend('/').split('/')[-1] -replace "\.git$", ''
$Target = (Get-Item $Dependency.Target -ErrorAction SilentlyContinue).FullName
#...

Needs more testing and a PR, but does that sound correct?