style: 💄 Fix format
This commit is contained in:
parent
286eb0a87e
commit
1554388ab7
5 changed files with 42 additions and 41 deletions
41
lib/index.js
41
lib/index.js
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue