-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-plugin.ps1
32 lines (26 loc) · 1.16 KB
/
build-plugin.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
$version = "1.0.9"
$project = "Webhooks"
$dllName = "WebhooksPlugin.dll"
$dllPath = "$($env:LOCALAPPDATA)/Loupedeck/Plugins/$project"
$buildPath = ".builds"
$outputFileName = "$project"
$zipPath = "$buildPath/$outputFileName.zip"
$pluginName = "$outputFileName.lplug4"
$loupedeckYaml = "LoupedeckPackage.yaml"
$cwd = Get-Location
if( Test-Path $buildPath){
Remove-Item -Path "$buildPath" -Force -Recurse
}
New-Item -Path "$buildPath" -Force -Name "bin" -ItemType "directory" > $null
New-Item -Path "$buildPath" -Force -Name "metadata" -ItemType "directory" > $null
Copy-Item "$loupedeckYaml" -Force -Destination "$buildPath\metadata\$loupedeckYaml" > $null
((Get-Content -Path "$buildPath\metadata\$loupedeckYaml" -Raw) -replace 'x.x.x', $version) | Set-Content "$buildPath\metadata\$loupedeckYaml"
Copy-Item "$($project)Plugin\Resources\256.png" -Force -Destination "$buildPath\metadata\256.png" > $null
Copy-Item "$dllPath\$dllName" -Force -Destination "$buildPath\bin\$dllName" > $null
$compress = @{
Path = "$buildPath\*"
CompressionLevel = "Fastest"
DestinationPath = $zipPath
}
Compress-Archive @Compress > $null
Rename-Item $zipPath -Force -NewName $pluginName > $null