fix: Add hugoBin for Windowns (hugo.exe)

This commit is contained in:
peaceiris 2019-09-20 07:27:37 +09:00
parent a488e041c8
commit cdd4e14db1
2 changed files with 14 additions and 4 deletions

View file

@ -31,10 +31,16 @@ async function run() {
core.addPath(hugoPath);
// Download and extract Hugo binary
const hugoTarball = await tc.downloadTool(hugoURL);
const hugoExtractedFolder = await tc.extractTar(hugoTarball, "/tmp");
core.debug("hugoExtractedFolder:", hugoExtractedFolder);
await io.mv(`${hugoExtractedFolder}/hugo`, hugoPath);
const hugoAssets = await tc.downloadTool(hugoURL);
let hugoBin = "";
if (osName === "Windows") {
const hugoExtractedFolder = await tc.extractZip(hugoAssets, "/tmp");
hugoBin = `${hugoExtractedFolder}/hugo.exe`;
} else {
const hugoExtractedFolder = await tc.extractTar(hugoAssets, "/tmp");
hugoBin = `${hugoExtractedFolder}/hugo`;
}
await io.mv(hugoBin, hugoPath);
// Show version
await exec.exec("hugo version");