fix: Add hugoBin for Windowns (hugo.exe)
This commit is contained in:
parent
a488e041c8
commit
cdd4e14db1
2 changed files with 14 additions and 4 deletions
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
|
@ -8,6 +8,8 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
|
@ -35,6 +37,8 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Test action
|
||||
uses: ./
|
||||
|
|
|
|||
14
lib/index.js
14
lib/index.js
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue