This commit is contained in:
peaceiris 2019-09-16 04:49:06 +09:00
parent 053422e2e1
commit b836447fac

View file

@ -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);
} }