feat: Add baseLocation
This commit is contained in:
parent
888750439c
commit
e372b56bb7
2 changed files with 24 additions and 2 deletions
14
lib/index.js
14
lib/index.js
|
|
@ -5163,7 +5163,19 @@ function installer(version) {
|
||||||
console.log(`Operating System: ${osName}`);
|
console.log(`Operating System: ${osName}`);
|
||||||
const hugoURL = get_url_1.default(osName, extended, version);
|
const hugoURL = get_url_1.default(osName, extended, version);
|
||||||
core.debug(`hugoURL: ${hugoURL}`);
|
core.debug(`hugoURL: ${hugoURL}`);
|
||||||
const hugoPath = path.join(`${process.env.HOME}`, 'bin');
|
let baseLocation;
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
baseLocation = process.env['USERPROFILE'] || 'C:\\';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
|
baseLocation = '/Users';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
baseLocation = '/home';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const hugoPath = path.join(baseLocation, 'actions', 'bin');
|
||||||
yield io.mkdirP(hugoPath);
|
yield io.mkdirP(hugoPath);
|
||||||
core.addPath(hugoPath);
|
core.addPath(hugoPath);
|
||||||
const hugoAssets = yield tc.downloadTool(hugoURL);
|
const hugoAssets = yield tc.downloadTool(hugoURL);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,17 @@ export default async function installer(version: string) {
|
||||||
const hugoURL: string = getURL(osName, extended, version);
|
const hugoURL: string = getURL(osName, extended, version);
|
||||||
core.debug(`hugoURL: ${hugoURL}`);
|
core.debug(`hugoURL: ${hugoURL}`);
|
||||||
|
|
||||||
const hugoPath: string = path.join(`${process.env.HOME}`, 'bin');
|
let baseLocation: string;
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
baseLocation = process.env['USERPROFILE'] || 'C:\\';
|
||||||
|
} else {
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
|
baseLocation = '/Users';
|
||||||
|
} else {
|
||||||
|
baseLocation = '/home';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const hugoPath: string = path.join(baseLocation, 'actions', 'bin');
|
||||||
await io.mkdirP(hugoPath);
|
await io.mkdirP(hugoPath);
|
||||||
core.addPath(hugoPath);
|
core.addPath(hugoPath);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue