style: 💄 Fix format

This commit is contained in:
peaceiris 2019-09-21 10:11:39 +09:00
parent 286eb0a87e
commit 1554388ab7
5 changed files with 42 additions and 41 deletions

View file

@ -26,28 +26,29 @@ const installer_1 = __importDefault(require("./installer"));
// most @actions toolkit packages have async methods
function run() {
return __awaiter(this, void 0, void 0, function* () {
const dump = () => __awaiter(this, void 0, void 0, function* () {
// Show version
yield exec.exec('hugo version');
yield exec.exec('go version');
yield exec.exec('git --version');
});
try {
get_latest_version_1.default().then(function (latestVersion) {
return __awaiter(this, void 0, void 0, function* () {
const hugoVersion = core.getInput("hugo-version");
console.log(`Hugo version: ${hugoVersion}`);
const version = (v, latestVersion) => {
if (v === "" || v === "latest") {
return latestVersion;
}
else {
return v;
}
};
yield installer_1.default(version(hugoVersion, latestVersion));
// Show version
yield exec.exec("hugo version");
yield exec.exec("go version");
yield exec.exec("git --version");
const hugoVersion = core.getInput('hugo-version');
console.log(`Hugo version: ${hugoVersion}`);
if (hugoVersion === '' || hugoVersion === 'latest') {
get_latest_version_1.default().then(function (latestVersion) {
return __awaiter(this, void 0, void 0, function* () {
yield installer_1.default(latestVersion);
yield dump();
});
}, function (error) {
core.setFailed(error);
});
}, function (error) {
core.setFailed(error);
});
}
else {
yield installer_1.default(hugoVersion);
yield dump();
}
}
catch (error) {
core.setFailed(error.message);