-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpackage.ps1
More file actions
32 lines (25 loc) · 819 Bytes
/
package.ps1
File metadata and controls
32 lines (25 loc) · 819 Bytes
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
param (
[string]$modName,
[string]$modVersion
)
# Configuration
$packageDir = '.\Package'
$artifactDir = '.\bin\Package\netstandard2.1'
# Make sure our CWD is where the script lives
Set-Location $PSScriptRoot
Write-Host ('Packaging {0} v{1}' -f $modName, $modVersion)
# Create the package structure
$bepInExDir = '{0}\BepInEx' -f $packageDir
$pluginsDir = '{0}\plugins\{1}' -f $bepInExDir, $modName
$null = mkdir $pluginsDir -ea 0
# Copy required files to the package structure
$artifactPath = ('{0}\{1}.dll' -f $artifactDir, $modName)
Copy-Item $artifactPath -Destination $pluginsDir
# Create the archive
$archivePath = '{0}\{1}-{2}.7z' -f $packageDir, $modName, $modVersion
if (Test-Path $archivePath)
{
Remove-Item $archivePath
}
7z a $archivePath $bepInExDir
Write-Host ('Mod packaging complete')