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 core = require('@actions/core');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const os = require('os');
|
||||||
const settings = require('./settings');
|
const settings = require('./settings');
|
||||||
|
|
||||||
|
|
||||||
@ -8,13 +9,7 @@ const settings = require('./settings');
|
|||||||
async function run() {
|
async function run() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var settingsPath;
|
const settingsPath = path.join(os.homedir(), '.m2', 'settings.xml');
|
||||||
try {
|
|
||||||
settingsPath= path.join(process.env['HOME'], '.m2', 'settings.xml');
|
|
||||||
} catch (error) {
|
|
||||||
console.log("HOME=" + process.env['HOME']);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
|
|
||||||
core.info('Prepare maven setings: ' + settingsPath);
|
core.info('Prepare maven setings: ' + settingsPath);
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ beforeAll(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
process.env['HOME'] = testHomePath;
|
process.env['HOME'] = testHomePath;
|
||||||
|
process.env['USERPROFILE'] = testHomePath;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user