Refactor: enhance Hugo version dumping (#39)
This commit is contained in:
parent
39aa1b7d04
commit
d7d48e3009
|
@ -32,10 +32,10 @@ function run() {
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
const hugoVersion = core.getInput('hugo-version');
|
const hugoVersion = core.getInput('hugo-version');
|
||||||
console.log(`Hugo version: ${hugoVersion}`);
|
|
||||||
if (hugoVersion === '' || hugoVersion === 'latest') {
|
if (hugoVersion === '' || hugoVersion === 'latest') {
|
||||||
get_latest_version_1.default().then(function (latestVersion) {
|
get_latest_version_1.default().then(function (latestVersion) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
console.log(`Hugo version: ${latestVersion} (${hugoVersion})`);
|
||||||
yield installer_1.default(latestVersion);
|
yield installer_1.default(latestVersion);
|
||||||
yield dump();
|
yield dump();
|
||||||
});
|
});
|
||||||
|
@ -44,6 +44,7 @@ function run() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
console.log(`Hugo version: ${hugoVersion}`);
|
||||||
yield installer_1.default(hugoVersion);
|
yield installer_1.default(hugoVersion);
|
||||||
yield dump();
|
yield dump();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,11 @@ async function run() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const hugoVersion: string = core.getInput('hugo-version');
|
const hugoVersion: string = core.getInput('hugo-version');
|
||||||
console.log(`Hugo version: ${hugoVersion}`);
|
|
||||||
|
|
||||||
if (hugoVersion === '' || hugoVersion === 'latest') {
|
if (hugoVersion === '' || hugoVersion === 'latest') {
|
||||||
getLatestVersion().then(
|
getLatestVersion().then(
|
||||||
async function(latestVersion): Promise<void> {
|
async function(latestVersion): Promise<void> {
|
||||||
|
console.log(`Hugo version: ${latestVersion} (${hugoVersion})`);
|
||||||
await installer(latestVersion);
|
await installer(latestVersion);
|
||||||
await dump();
|
await dump();
|
||||||
},
|
},
|
||||||
|
@ -25,6 +25,7 @@ async function run() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
console.log(`Hugo version: ${hugoVersion}`);
|
||||||
await installer(hugoVersion);
|
await installer(hugoVersion);
|
||||||
await dump();
|
await dump();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue