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

@ -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: ./

View file

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