mirror of
https://github.com/s4u/maven-settings-action.git
synced 2026-02-12 00:05:49 +08:00
windows home directory
This commit is contained in:
9
index.js
9
index.js
@ -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);
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ beforeAll(() => {
|
||||
}
|
||||
|
||||
process.env['HOME'] = testHomePath;
|
||||
process.env['USERPROFILE'] = testHomePath;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user