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 b35633a commit 2baa32f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
11 changes: 6 additions & 5 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31881,7 +31881,12 @@ const tool_cache_1 = __nccwpck_require__(7784);
const semver_1 = __nccwpck_require__(1383);
function getManifest(auth) {
return __awaiter(this, void 0, void 0, function* () {
return yield (0, tool_cache_1.getManifestFromRepo)('hhgyu', 'virtualhere-client-versions', auth, 'main');
const manifest = yield (0, tool_cache_1.getManifestFromRepo)('hhgyu', 'virtualhere-client-versions', auth, 'main');
if (Object.hasOwn(manifest, 'version')) {
// 버전이 한개 일때 배열이 아니라 오브젝드로 반환됨
return [manifest];
}
return manifest;
});
}
exports.getManifest = getManifest;
Expand Down Expand Up @@ -31910,10 +31915,6 @@ function getVC(versionSpec, stable, checkLatest, auth, arch = node_os_1.default.
const osPlat = node_os_1.default.platform();
if (stable) {
manifest = yield getManifest(auth);
if (!(Object.hasOwn(manifest, 'version') ||
(Array.isArray(manifest) && manifest.length > 0))) {
throw new Error('not found manifest');
}
const stableVersion = yield resolveStableVersionInput(stable, arch, osPlat, manifest);
if (stableVersion) {
core.info(`stable version resolved as ${stableVersion}`);
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js.map

Large diffs are not rendered by default.

19 changes: 8 additions & 11 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,19 @@ export interface IVCVersionInfo {
}

export async function getManifest(auth: string | undefined) {
return await getManifestFromRepo(
const manifest = await getManifestFromRepo(
'hhgyu',
'virtualhere-client-versions',
auth,
'main'
);

if (Object.hasOwn(manifest, 'version')) {
// 버전이 한개 일때 배열이 아니라 오브젝드로 반환됨
return [manifest as unknown as IToolRelease];
}

return manifest;
}

export async function getInfoFromManifest(
Expand Down Expand Up @@ -83,16 +90,6 @@ export async function getVC(

if (stable) {
manifest = await getManifest(auth);

if (
!(
Object.hasOwn(manifest, 'version') ||
(Array.isArray(manifest) && manifest.length > 0)
)
) {
throw new Error('not found manifest');
}

const stableVersion = await resolveStableVersionInput(
stable,
arch,
Expand Down

0 comments on commit 2baa32f

Please sign in to comment.