File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ $array = @ (" HC" )
2
+ $dir = $PSScriptRoot + " /bin/"
3
+ $copy = $dir + " /copy"
4
+
5
+ Remove-Item - Force - Path ($dir + " /copy" ) - Recurse - ErrorAction SilentlyContinue
6
+ Remove-Item - Force - Path ($dir + " /out" ) - Recurse - ErrorAction SilentlyContinue
7
+ New-Item - ItemType Directory - Force - Path ($copy + " /plugins" )
8
+ New-Item - ItemType Directory - Force - Path ($dir + " /out" )
9
+
10
+ foreach ($element in $array )
11
+ {
12
+ foreach ($filepath in [System.IO.Directory ]::EnumerateFiles($dir , " *.dll" , " AllDirectories" ))
13
+ {
14
+ $filename = $filepath.Replace ($dir , " " )
15
+
16
+ if ($filename.StartsWith ($element ))
17
+ {
18
+ Remove-Item - Force - Path ($copy ) - Recurse
19
+ New-Item - ItemType Directory - Force - Path ($copy + " /BepInEx/plugins/" + $element + " _Plugins/" )
20
+
21
+ Copy-Item - Path ($filepath ) - Destination ($copy + " /BepInEx/plugins/" + $element + " _Plugins/" ) - Force
22
+
23
+ $filepathxml = get-childitem $dir - Recurse - Force - include $filename.Replace (" .dll" , " .xml" ) - ErrorAction SilentlyContinue
24
+ if ($filepathxml )
25
+ {
26
+ Copy-Item - Path ($filepathxml ) - Destination ($copy + " /BepInEx/plugins/" + $element + " _Plugins/" ) - Force
27
+ }
28
+
29
+ $version = " v" + ((Get-ChildItem - Path ($filepath ) - Filter " *.dll" - Force)[0 ].VersionInfo.FileVersion.ToString() -replace " ^([\d+\.]+?\d+)[\.0]*$" , ' ${1}' )
30
+ $zipfilename = $filename.Replace (" .dll" , " " + $version + " .zip" )
31
+
32
+ " Creating archive: " + $zipfilename
33
+ Compress-Archive - Path ($copy + " \*" ) - Force - CompressionLevel " Optimal" - DestinationPath ($dir + " out/" + $zipfilename )
34
+ }
35
+ }
36
+ }
37
+
38
+ Remove-Item - Force - Path ($dir + " /copy" ) - Recurse
You can’t perform that action at this time.
0 commit comments