Skip to content

Commit

Permalink
Add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
DeathWeasel1337 committed Jul 15, 2020
1 parent 7181594 commit 2a84e48
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$dir = $PSScriptRoot + "/bin/"
$copy = $dir + "/copy/BepInEx"

Remove-Item -Force -Path ($dir + "/copy") -Recurse -ErrorAction SilentlyContinue
Remove-Item -Force -Path ($dir + "/out") -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path ($copy + "/plugins")
New-Item -ItemType Directory -Force -Path ($dir + "/out")

foreach ($filepath in [System.IO.Directory]::EnumerateFiles($dir,"*.dll"))
{
$filename = $filepath.Replace($dir, "")

Remove-Item -Force -Path ($copy) -Recurse
New-Item -ItemType Directory -Force -Path ($copy + "/plugins/")
Copy-Item -Path ($filepath) -Destination ($copy + "/plugins/") -Force

$version = "v" + (Get-ChildItem -Path ($filepath) -Filter "*.dll" -Force)[0].VersionInfo.FileVersion.ToString()
$zipfilename = $filename.Replace(".dll", " " + $version + ".zip")

"Creating archive: " + $zipfilename
Compress-Archive -Path $copy -Force -CompressionLevel "Optimal" -DestinationPath ($dir + "out/" + $zipfilename)
}

Remove-Item -Force -Path ($dir + "/copy") -Recurse

0 comments on commit 2a84e48

Please sign in to comment.