Skip to content

Commit

Permalink
오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hhgyu committed Dec 4, 2023
1 parent a50a327 commit 9fa76dd
Show file tree
Hide file tree
Showing 9 changed files with 578 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/cleanup/index.js.map

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions dist/setup/Invoke-7zdec.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Source,

[Parameter(Mandatory = $true)]
[string]$Target)

# This script translates the output from 7zdec into UTF8. Node has limited
# built-in support for encodings.
#
# 7zdec uses the system default code page. The system default code page varies
# depending on the locale configuration. On an en-US box, the system default code
# page is Windows-1252.
#
# Note, on a typical en-US box, testing with the 'ç' character is a good way to
# determine whether data is passed correctly between processes. This is because
# the 'ç' character has a different code point across each of the common encodings
# on a typical en-US box, i.e.
# 1) the default console-output code page (IBM437)
# 2) the system default code page (i.e. CP_ACP) (Windows-1252)
# 3) UTF8

$ErrorActionPreference = 'Stop'

# Redefine the wrapper over STDOUT to use UTF8. Node expects UTF8 by default.
$stdout = [System.Console]::OpenStandardOutput()
$utf8 = New-Object System.Text.UTF8Encoding($false) # do not emit BOM
$writer = New-Object System.IO.StreamWriter($stdout, $utf8)
[System.Console]::SetOut($writer)

# All subsequent output must be written using [System.Console]::WriteLine(). In
# PowerShell 4, Write-Host and Out-Default do not consider the updated stream writer.

Set-Location -LiteralPath $Target

# Print the ##command.
$_7zdec = Join-Path -Path "$PSScriptRoot" -ChildPath "externals/7zdec.exe"
[System.Console]::WriteLine("##[command]$_7zdec x `"$Source`"")

# The $OutputEncoding variable instructs PowerShell how to interpret the output
# from the external command.
$OutputEncoding = [System.Text.Encoding]::Default

# Note, the output from 7zdec.exe needs to be iterated over. Otherwise PowerShell.exe
# will launch the external command in such a way that it inherits the streams.
& $_7zdec x $Source 2>&1 |
ForEach-Object {
if ($_ -is [System.Management.Automation.ErrorRecord]) {
[System.Console]::WriteLine($_.Exception.Message)
}
else {
[System.Console]::WriteLine($_)
}
}
[System.Console]::WriteLine("##[debug]7zdec.exe exit code '$LASTEXITCODE'")
[System.Console]::Out.Flush()
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Binary file added dist/setup/externals/7zdec.exe
Binary file not shown.
3 changes: 1 addition & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31963,14 +31963,13 @@ function getVC(versionSpec, stable, checkLatest, auth, arch = node_os_1.default.
if (err.stack) {
core.debug(err.stack);
}
core.info('Falling back to download directly from VirtualHere-Client');
}
else {
core.info(`${err}: Unexpected Error`);
}
}
if (!downloadPath) {
throw new Error(`Unable to find Go version '${versionSpec}' for platform ${osPlat} and architecture ${arch}.`);
throw new Error(`Unable to find VirtualHere-Client version '${versionSpec}' for platform ${osPlat} and architecture ${arch}.`);
}
return downloadPath;
});
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 9fa76dd

Please sign in to comment.