Skip to content

Commit

Permalink
chore: run ncc
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Dec 30, 2019
1 parent 442cd42 commit 3af306b
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2840,6 +2840,15 @@ function coerce (version, options) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
Expand Down Expand Up @@ -2878,18 +2887,18 @@ function getLatest(api, data) {
return latestVersion;
}
function getLatestVersion(org, repo, api) {
return new Promise((resolve, reject) => {
return __awaiter(this, void 0, void 0, function* () {
const xhr = new XMLHttpRequest();
const url = getURL(org, repo, api);
xhr.open('GET', url);
xhr.send();
xhr.onload = () => {
const result = JSON.parse(xhr.responseText);
const latestVersion = getLatest(api, result);
resolve(latestVersion);
return latestVersion;
};
xhr.onerror = () => {
reject(`ERROR: got status ${xhr.status} of ${url}`);
throw `ERROR: got status ${xhr.status} of ${url}`;
};
});
}
Expand Down Expand Up @@ -3562,15 +3571,10 @@ function run() {
try {
const mdbookVersion = core.getInput('mdbook-version');
if (mdbookVersion === '' || mdbookVersion === 'latest') {
get_latest_version_1.default('rust-lang', 'mdbook', 'brew').then(function (latestVersion) {
return __awaiter(this, void 0, void 0, function* () {
console.log(`mdbook version: ${latestVersion} (${mdbookVersion})`);
yield installer_1.default(latestVersion);
yield showVersion();
});
}, function (error) {
core.setFailed(error);
});
const latestVersion = yield get_latest_version_1.default('rust-lang', 'mdbook', 'brew');
console.log(`mdbook version: ${latestVersion} (${mdbookVersion})`);
yield installer_1.default(latestVersion);
yield showVersion();
}
else {
console.log(`mdbook version: ${mdbookVersion}`);
Expand Down

0 comments on commit 3af306b

Please sign in to comment.