reindent
This commit is contained in:
parent
053422e2e1
commit
b836447fac
1 changed files with 27 additions and 28 deletions
7
index.js
7
index.js
|
@ -7,12 +7,10 @@ const getLatestVersion = require("./get-latest-version");
|
||||||
// most @actions toolkit packages have async methods
|
// most @actions toolkit packages have async methods
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
|
getLatestVersion().then(function(latestVersion) {
|
||||||
let hugoVersion = core.getInput("hugo-version");
|
let hugoVersion = core.getInput("hugo-version");
|
||||||
if (!hugoVersion || hugoVersion === "latest") {
|
if (!hugoVersion || hugoVersion === "latest") {
|
||||||
hugoVersion = "0.58.2";
|
hugoVersion = latestVersion;
|
||||||
getLatestVersion().then(function(version) {
|
|
||||||
console.log(version);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
core.debug(`Hugo version: ${hugoVersion}`);
|
core.debug(`Hugo version: ${hugoVersion}`);
|
||||||
|
|
||||||
|
@ -41,6 +39,7 @@ async function run() {
|
||||||
const hugoExtractedFolder = await tc.extractTar(hugoTarball, "/tmp");
|
const hugoExtractedFolder = await tc.extractTar(hugoTarball, "/tmp");
|
||||||
core.debug("hugoExtractedFolder:", hugoExtractedFolder);
|
core.debug("hugoExtractedFolder:", hugoExtractedFolder);
|
||||||
await exec.exec("sudo", ["mv", `${hugoExtractedFolder}/hugo`, hugoPath]);
|
await exec.exec("sudo", ["mv", `${hugoExtractedFolder}/hugo`, hugoPath]);
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue