@@ -182,6 +182,7 @@ function New-UniversalModPackage {
182
182
}
183
183
184
184
Remove-Item $tempDir - Recurse - Force - EA 0 | Out-Null
185
+ New-Item - Path $tempDir - ItemType Directory - Force | Out-Null
185
186
New-Item - Path $tempDir \$outIEMod \$ModID - ItemType Directory - Force | Out-Null
186
187
New-Item - Path $tempDir \$outZip \$ModID - ItemType Directory - Force | Out-Null
187
188
@@ -202,26 +203,23 @@ function New-UniversalModPackage {
202
203
Copy-Item - Path $ModTopDirectory \$ModID \* - Destination $tempDir \$outZip \$ModID - Recurse - Exclude $regexAny | Out-Null
203
204
204
205
# get latest weidu version
205
- $datalastRelease = Invoke-RestMethod - Uri " https://api.github.com/repos/weiduorg/weidu/releases/latest" - Headers $Headers - Method Get
206
+ $datalastRelease = Invoke-RestMethod - Uri ' https://api.github.com/repos/weiduorg/weidu/releases/latest' - Headers $Headers - Method Get
206
207
$weiduWinUrl = $datalastRelease.assets | ? name -Match ' Windows' | Select-Object - ExpandProperty browser_download_url
207
208
$weiduMacUrl = $datalastRelease.assets | ? name -Match ' Mac' | Select-Object - ExpandProperty browser_download_url
208
209
209
- Invoke-WebRequest - Uri $weiduWinUrl - Headers $Headers - OutFile ' $tempDir\WeiDU-Windows.zip' - PassThru | Out-Null
210
- Expand-Archive - Path ' $tempDir\WeiDU-Windows.zip' - DestinationPath ' . ' | Out-Null
210
+ Invoke-WebRequest - Uri $weiduWinUrl - Headers $Headers - OutFile " $tempDir \WeiDU-Windows.zip" - PassThru | Out-Null
211
+ Expand-Archive - Path " $tempDir \WeiDU-Windows.zip" - DestinationPath " $tempDir \ " | Out-Null
211
212
212
- Invoke-WebRequest - Uri $weiduMacUrl - Headers $Headers - OutFile ' $tempDir\WeiDU-Mac.zip' - PassThru | Out-Null
213
- Expand-Archive - Path ' $tempDir\WeiDU-Mac.zip' - DestinationPath ' . ' | Out-Null
213
+ Invoke-WebRequest - Uri $weiduMacUrl - Headers $Headers - OutFile " $tempDir \WeiDU-Mac.zip" - PassThru | Out-Null
214
+ Expand-Archive - Path " $tempDir \WeiDU-Mac.zip" - DestinationPath " $tempDir \ " | Out-Null
214
215
215
216
# Copy latest WeiDU versions
216
217
Copy-Item " $tempDir \WeiDU-Windows\bin\amd64\weidu.exe" " $tempDir \$outZip \$weiduExeBaseName .exe" | Out-Null
217
- Copy-Item " $tempDir \WeiDU-Mac\bin\amd64\weidu" " $tempDir \$outZip \$weiduExeBaseName " | Out-Null
218
+ Copy-Item " $tempDir \WeiDU-Mac\bin\amd64\weidu" " $tempDir \$outZip \$ ( $ weiduExeBaseName.tolower () ) " | Out-Null
218
219
219
220
# Create .command script
220
221
' cd "${0%/*}"' + " `n " + ' ScriptName="${0##*/}"' + " `n " + ' ./${ScriptName%.*}' | Out-File - FilePath " $tempDir \$outZip \$ ( $weiduExeBaseName.tolower ()) .command" | Out-Null
221
222
222
- # Copy-Item over weidu.command script
223
- Copy-Item " $PSScriptRoot \weidu\weidu.command" " $tempDir \$outZip \$ ( $weiduExeBaseName.tolower ()) .command" | Out-Null
224
-
225
223
Write-Host " Creating $PackageBaseName .zip" - ForegroundColor Green
226
224
227
225
Compress-Archive - Path $tempDir \$outZip \* - DestinationPath " $ModTopDirectory \$PackageBaseName .zip" - Force - CompressionLevel Optimal | Out-Null
0 commit comments