mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-23 04:46:08 -08:00
fix(build): extract Yomitan on Windows without the Archive module
PowerShell 7's PSModulePath makes powershell.exe load the PS7 Archive module, whose ExtractToDirectory overload is missing on .NET Framework, so Expand-Archive silently extracted nothing on the windows-latest runner.
This commit is contained in:
1 file changed
+4
-1
@@ -108,6 +108,9 @@ function extractBuild() {
|
||||
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'subminer-yomitan-'));
|
||||
try {
|
||||
if (process.platform === 'win32') {
|
||||
// Call .NET directly instead of Expand-Archive: under a pwsh CI step, PSModulePath
|
||||
// makes Windows PowerShell load PowerShell 7's Archive module, whose
|
||||
// ExtractToDirectory overload does not exist on .NET Framework.
|
||||
run(
|
||||
'powershell.exe',
|
||||
[
|
||||
@@ -116,7 +119,7 @@ function extractBuild() {
|
||||
'-ExecutionPolicy',
|
||||
'Bypass',
|
||||
'-Command',
|
||||
`Expand-Archive -LiteralPath '${escapePowerShellString(zipPath)}' -DestinationPath '${escapePowerShellString(tempDir)}' -Force`,
|
||||
`$ErrorActionPreference = 'Stop'; Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapePowerShellString(zipPath)}', '${escapePowerShellString(tempDir)}')`,
|
||||
],
|
||||
repoRoot,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user