From 38963a7f403386e1dfc301be499a61885c86b1ac Mon Sep 17 00:00:00 2001 From: peaceiris <30958501+peaceiris@users.noreply.github.com> Date: Fri, 22 Nov 2019 10:35:30 +0900 Subject: [PATCH] fix: baseLocation --- lib/index.js | 11 ++++------- src/installer.ts | 10 ++++------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/index.js b/lib/index.js index 19354c7..073df90 100644 --- a/lib/index.js +++ b/lib/index.js @@ -5168,14 +5168,11 @@ function installer(version) { baseLocation = process.env['USERPROFILE'] || 'C:\\'; } else { - if (process.platform === 'darwin') { - baseLocation = '/Users'; - } - else { - baseLocation = '/home'; - } + baseLocation = `${process.env.HOME}`; } - const hugoPath = path.join(baseLocation, 'actions', 'bin'); + console.log(`${process.env.HOME}`); + console.log(baseLocation); + const hugoPath = path.join(baseLocation, 'hugobin'); yield io.mkdirP(hugoPath); core.addPath(hugoPath); const hugoAssets = yield tc.downloadTool(hugoURL); diff --git a/src/installer.ts b/src/installer.ts index b9ba6ec..a1db3ef 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -20,13 +20,11 @@ export default async function installer(version: string) { if (process.platform === 'win32') { baseLocation = process.env['USERPROFILE'] || 'C:\\'; } else { - if (process.platform === 'darwin') { - baseLocation = '/Users'; - } else { - baseLocation = '/home'; - } + baseLocation = `${process.env.HOME}`; } - const hugoPath: string = path.join(baseLocation, 'actions', 'bin'); + console.log(`${process.env.HOME}`); + console.log(baseLocation); + const hugoPath: string = path.join(baseLocation, 'hugobin'); await io.mkdirP(hugoPath); core.addPath(hugoPath);