Skip to content

Commit

Permalink
feat: ✨ add a cache check to $bootstrapper.LoadNative() (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonhostpi committed Jan 19, 2024
1 parent f5b597a commit 943d6d5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Import-Package/packaging.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,14 @@ public static extern IntPtr dlopen(string path, int flags);
If( -not (Test-Path $CopyTo -PathType Container) ){
New-Item -ItemType Directory -Path $CopyTo -Force
}
Write-Verbose "Loading native dll from path '$CopyTo' (copied from '$Path')."
Copy-Item $Path $CopyTo -Force -ErrorAction SilentlyContinue | Out-Null
$Path = "$CopyTo\$($Path | Split-Path -Leaf)"
Write-Verbose "Loading native dll from path '$CopyTo' (copying from '$Path')."
$end_path = "$CopyTo\$($Path | Split-Path -Leaf)"
If( -not (Test-Path $end_path -PathType Leaf) ){
Copy-Item $Path $CopyTo -Force -ErrorAction SilentlyContinue | Out-Null
} Else {
Write-Verbose "$CopyTo is already present and loaded. Native dll not copied - This could cause version conflicts"
}
$Path = $end_path
} Else {
Write-Verbose "Loading native dll from path '$Path'."
}
Expand Down

0 comments on commit 943d6d5

Please sign in to comment.