Skip to content

Commit 731e910

Browse files
committedNov 17, 2019
2.1.2
1 parent 2e30325 commit 731e910

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed
 

‎#ModRelease/#ModRelease.ps1

+7-9
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ function New-UniversalModPackage {
182182
}
183183

184184
Remove-Item $tempDir -Recurse -Force -EA 0 | Out-Null
185+
New-Item -Path $tempDir -ItemType Directory -Force | Out-Null
185186
New-Item -Path $tempDir\$outIEMod\$ModID -ItemType Directory -Force | Out-Null
186187
New-Item -Path $tempDir\$outZip\$ModID -ItemType Directory -Force | Out-Null
187188

@@ -202,26 +203,23 @@ function New-UniversalModPackage {
202203
Copy-Item -Path $ModTopDirectory\$ModID\* -Destination $tempDir\$outZip\$ModID -Recurse -Exclude $regexAny | Out-Null
203204

204205
# 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
206207
$weiduWinUrl = $datalastRelease.assets | ? name -Match 'Windows' | Select-Object -ExpandProperty browser_download_url
207208
$weiduMacUrl = $datalastRelease.assets | ? name -Match 'Mac' | Select-Object -ExpandProperty browser_download_url
208209

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
211212

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
214215

215216
# Copy latest WeiDU versions
216217
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
218219

219220
# Create .command script
220221
'cd "${0%/*}"' + "`n" + 'ScriptName="${0##*/}"' + "`n" + './${ScriptName%.*}' | Out-File -FilePath "$tempDir\$outZip\$($weiduExeBaseName.tolower()).command" | Out-Null
221222

222-
# Copy-Item over weidu.command script
223-
Copy-Item "$PSScriptRoot\weidu\weidu.command" "$tempDir\$outZip\$($weiduExeBaseName.tolower()).command" | Out-Null
224-
225223
Write-Host "Creating $PackageBaseName.zip" -ForegroundColor Green
226224

227225
Compress-Archive -Path $tempDir\$outZip\* -DestinationPath "$ModTopDirectory\$PackageBaseName.zip" -Force -CompressionLevel Optimal | Out-Null

0 commit comments

Comments
 (0)
Please sign in to comment.