Skip to content

Commit

Permalink
husky 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hhgyu committed Dec 4, 2023
1 parent 2c64c54 commit 1830668
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run pre-checkin
7 changes: 7 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"husky": {
"hooks": {
"pre-commit": "npm run pre-checkin"
}
}
}
1 change: 1 addition & 0 deletions dist/cleanup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24795,6 +24795,7 @@ function run() {
});
}
exports.run = run;
run();


/***/ }),
Expand Down
2 changes: 1 addition & 1 deletion dist/cleanup/index.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31881,7 +31881,7 @@ 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 (0, tool_cache_1.getManifestFromRepo)('hhgyu', 'virtualhere-client-versions', auth, 'main');
return yield (0, tool_cache_1.getManifestFromRepo)('hhgyu', 'virtualhere-client-versions', auth, 'main');
});
}
exports.getManifest = getManifest;
Expand Down Expand Up @@ -31910,6 +31910,10 @@ 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.

8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@
"format-check": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --check \"**/*.{ts,yml,yaml}\"",
"lint": "eslint --config ./.eslintrc.js \"**/*.ts\"",
"lint:fix": "eslint --config ./.eslintrc.js \"**/*.ts\" --fix",
"pre-checkin": "npm run format && npm run lint:fix && npm run build"
"pre-checkin": "npm run format && npm run lint:fix && npm run build",
"prepare": "husky install"
},
"author": "hhgyu15@gmail.com",
"license": "ISC",
"husky": {
"hooks": {
"pre-commit": "npm run pre-checkin"
}
},
"devDependencies": {
"@actions/core": "^1.10.1",
"@actions/http-client": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ export async function run() {
}
}

run();
run();
12 changes: 9 additions & 3 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface IVCVersionInfo {
}

export async function getManifest(auth: string | undefined) {
return getManifestFromRepo(
return await getManifestFromRepo(
'hhgyu',
'virtualhere-client-versions',
auth,
Expand Down Expand Up @@ -83,8 +83,14 @@ export async function getVC(

if (stable) {
manifest = await getManifest(auth);
core.debug(`manifest: ${manifest}`);


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 1830668

Please sign in to comment.