windows home directory

This commit is contained in:
Slawomir Jaranowski
2019-10-03 09:06:12 +02:00
parent d715271c3a
commit bcf2e289fb
2 changed files with 3 additions and 7 deletions

View File

@ -1,6 +1,7 @@
const core = require('@actions/core');
const path = require('path');
const fs = require('fs');
const os = require('os');
const settings = require('./settings');
@ -8,13 +9,7 @@ const settings = require('./settings');
async function run() {
try {
var settingsPath;
try {
settingsPath= path.join(process.env['HOME'], '.m2', 'settings.xml');
} catch (error) {
console.log("HOME=" + process.env['HOME']);
throw error;
}
const settingsPath = path.join(os.homedir(), '.m2', 'settings.xml');
core.info('Prepare maven setings: ' + settingsPath);

View File

@ -13,6 +13,7 @@ beforeAll(() => {
}
process.env['HOME'] = testHomePath;
process.env['USERPROFILE'] = testHomePath;
});
afterEach(() => {