|
5 | 5 | # } catch {} |
6 | 6 | # $Arch = "-" + [Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture |
7 | 7 |
|
8 | | -Get-ChildItem -Directory -Path $PSScriptRoot\runtimes\ -Recurse -Filter 'native' | |
9 | | - ForEach-Object { |
10 | | - # For windows |
11 | | - $env:PATH = '{0}{1}{2}' -f @( |
12 | | - $_.FullName |
13 | | - [System.IO.Path]::PathSeparator |
14 | | - $env:PATH |
15 | | - ) |
16 | | - # For Linux |
17 | | - $env:LD_LIBRARY_PATH = '{0}{1}{2}' -f @( |
18 | | - $_.FullName |
19 | | - [System.IO.Path]::PathSeparator |
20 | | - $env:LD_LIBRARY_PATH |
21 | | - ) |
22 | | - # For macOS |
23 | | - $env:DYLD_LIBRARY_PATH = '{0}{1}{2}' -f @( |
24 | | - $_.FullName |
25 | | - [System.IO.Path]::PathSeparator |
26 | | - $env:DYLD_LIBRARY_PATH |
27 | | - ) |
| 8 | +# Add-Type -Path (Join-Path (Join-Path $PSScriptRoot NativeBinaries\$runtime) |
| 9 | +${;} = [System.IO.Path]::PathSeparator |
| 10 | +switch -Wildcard (Get-ChildItem -Path "$PSScriptRoot\lib\NativeBinaries\*\native" -Recurse -Filter '*git2-6311e88.*') { |
| 11 | + "*.so" { $env:LD_LIBRARY_PATH = "" + $_.Directory + ${;} + $Env:LD_LIBRARY_PATH } |
| 12 | + "*.dll" { $env:PATH = "" + $_.Directory + ${;} + $Env:PATH } |
| 13 | + "*.dyld" { $env:DYLD_LIBRARY_PATH = "" + $_.Directory + ${;} + $Env:DYLD_LIBRARY_PATH } |
28 | 14 | } |
29 | 15 |
|
| 16 | + |
30 | 17 | # Internal Functions |
31 | 18 | #region Interal Functions |
32 | 19 | function WriteMessage { |
@@ -260,10 +247,12 @@ function Get-Change { |
260 | 247 | } |
261 | 248 |
|
262 | 249 | $BranchProperties = |
263 | | - @{ Name="Branch"; Expr={$_.Name}}, |
| 250 | + @{ Name="Branch"; Expr={$_.FriendlyName}}, # Changed in LibGit2Sharp 0.25 |
264 | 251 | @{ Name="IsHead"; Expr={ $_.IsCurrentRepositoryHead}}, "IsRemote", "IsTracking", |
265 | 252 | @{ Name="Tip"; Expr={$_.Tip.Sha}}, |
266 | | - @{ Name="Remote"; expr = { $_.Remote.Url } }, |
| 253 | + # This got more expensive in LibGit2Sharp 0.25 |
| 254 | + # Might be easier to use RemoteName, but to maintain compatibility: |
| 255 | + @{ Name="Remote"; expr = { $_.Repository.Network.Remotes[$_.RemoteName].Url } }, |
267 | 256 | @{ Name="Ahead"; Expr= { $_.TrackingDetails.AheadBy }}, |
268 | 257 | @{ Name="Behind"; Expr = { $_.TrackingDetails.BehindBy }}, |
269 | 258 | @{ Name="CommonAncestor"; Expr={ $_.TrackingDetails.CommonAncestor.Sha }}, |
|
0 commit comments