refactor: Add getURL()
This commit is contained in:
parent
13ddb0fba5
commit
a488e041c8
4 changed files with 37 additions and 9 deletions
10
lib/index.js
10
lib/index.js
|
|
@ -3,6 +3,7 @@ const tc = require("@actions/tool-cache");
|
|||
const io = require("@actions/io");
|
||||
const exec = require("@actions/exec");
|
||||
const getOS = require("./get-os");
|
||||
const getURL = require("./get-url");
|
||||
const getLatestVersion = require("./get-latest-version");
|
||||
|
||||
// most @actions toolkit packages have async methods
|
||||
|
|
@ -18,18 +19,11 @@ async function run() {
|
|||
|
||||
const extended = core.getInput("extended");
|
||||
console.log(`Hugo extended: ${extended}`);
|
||||
let extendedStr = "";
|
||||
if (extended === "true") {
|
||||
extendedStr = "extended_";
|
||||
}
|
||||
|
||||
const osName = getOS(process.platform);
|
||||
console.log(`Operating System: ${osName}`);
|
||||
|
||||
const hugoName = `hugo_${extendedStr}${hugoVersion}_${osName}-64bit`;
|
||||
core.debug(`hugoName: ${hugoName}`);
|
||||
|
||||
const hugoURL = `https://github.com/gohugoio/hugo/releases/download/v${hugoVersion}/${hugoName}.tar.gz`;
|
||||
const hugoURL = getURL(osName, extended, hugoVersion);
|
||||
core.debug(`hugoURL: ${hugoURL}`);
|
||||
|
||||
const hugoPath = `${process.env.HOME}/bin`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue