feat: Add baseLocation

This commit is contained in:
peaceiris 2019-11-22 10:26:02 +09:00
parent 888750439c
commit e372b56bb7
2 changed files with 24 additions and 2 deletions

View file

@ -5163,7 +5163,19 @@ function installer(version) {
console.log(`Operating System: ${osName}`);
const hugoURL = get_url_1.default(osName, extended, version);
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);
core.addPath(hugoPath);
const hugoAssets = yield tc.downloadTool(hugoURL);