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:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
@ -35,6 +37,8 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Test action
|
- name: Test action
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|
|
||||||
14
lib/index.js
14
lib/index.js
|
|
@ -31,10 +31,16 @@ async function run() {
|
||||||
core.addPath(hugoPath);
|
core.addPath(hugoPath);
|
||||||
|
|
||||||
// Download and extract Hugo binary
|
// Download and extract Hugo binary
|
||||||
const hugoTarball = await tc.downloadTool(hugoURL);
|
const hugoAssets = await tc.downloadTool(hugoURL);
|
||||||
const hugoExtractedFolder = await tc.extractTar(hugoTarball, "/tmp");
|
let hugoBin = "";
|
||||||
core.debug("hugoExtractedFolder:", hugoExtractedFolder);
|
if (osName === "Windows") {
|
||||||
await io.mv(`${hugoExtractedFolder}/hugo`, hugoPath);
|
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
|
// Show version
|
||||||
await exec.exec("hugo version");
|
await exec.exec("hugo version");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue