-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComposeRelease.ps1
33 lines (29 loc) · 1.42 KB
/
ComposeRelease.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Set-Location "C:\Users\markp\Documents\GitHub\AGNSharpBot"
$currentPath = Get-Location
Write-Host "Script running in location $currentPath"
$plugins = Get-Item -Path ".\Plugins\Binaries\*"
$pluginNames = Get-Item -Path ".\AGNSharpBot_v2\bin\Release\net6.0\Plugins\*" -Filter "*.dll"
$destPath = $currentPath.Path + "\AGNSharpBot_v2\bin\Release\net6.0\"
foreach ( $plugin in $plugins )
{
$pluginPath = $plugin.FullName + "\bin\Release\net6.0"
if ( [System.IO.Directory]::Exists($pluginPath) )
{
$filesToMain = Get-Item -Path "$pluginPath\*" -Filter "*.dll" | Where-object { $_.Name -ne $($plugin.Name + ".dll") }
#$pluginFile = Get-Item -Path "$pluginPath\*" -Filter "*.dll" | Where-object { $pluginNames.Name -contains $_.Name }
$pluginFile = Get-Item -Path "$pluginPath\*" -Filter "*.dll" | Where-object { $_.Name -eq $($plugin.Name + ".dll") }
foreach ( $file in $filesToMain )
{
if ( [System.IO.File]::Exists("$currentPath" + "$destPath$($file.Name)") -eq $false )
{
Copy-Item -Path $file.FullName -Destination $destPath
Write-Host "Copied $($file.Name) library to Main Working Directory";
}
}
foreach ( $file in $pluginFile )
{
Copy-Item -Path $file.FullName -Destination "$destPath\Plugins\"
Write-Host "Copied $($file.Name) library to Plugin Directory";
}
}
}