1
0
Fork 0
mirror of https://github.com/actions/setup-java synced 2024-11-09 23:22:40 +00:00

build release

This commit is contained in:
Bryan Clark 2019-12-06 14:46:43 -05:00
parent 6ae690c576
commit f33acc6b4f

15
dist/index.js generated vendored
View file

@ -4134,8 +4134,7 @@ function configAuthentication(id, username, password) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
if (id && username && password) { if (id && username && password) {
console.log(`creating ${exports.SETTINGS_FILE} with server-id: ${id}, username: ${username}, and a password`); console.log(`creating ${exports.SETTINGS_FILE} with server-id: ${id}, username: ${username}, and a password`);
const home = process.env['GITHUB_WORKSPACE'] || os.homedir(); const directory = path.join(os.homedir(), exports.M2_DIR);
const directory = path.join(home, exports.M2_DIR);
yield io.mkdirP(directory); yield io.mkdirP(directory);
core.debug(`created directory ${directory}`); core.debug(`created directory ${directory}`);
yield write(directory, generate(id, username, password)); yield write(directory, generate(id, username, password));
@ -4165,15 +4164,17 @@ function write(directory, settings) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const options = { encoding: 'utf-8', flag: 'wx' }; // 'wx': Like 'w' but fails if path exists const options = { encoding: 'utf-8', flag: 'wx' }; // 'wx': Like 'w' but fails if path exists
const location = path.join(directory, exports.SETTINGS_FILE); const location = path.join(directory, exports.SETTINGS_FILE);
console.log(`writing ${location} with options ${options}`); console.log(`writing ${location}`);
try { try {
return fs.writeFileSync(location, settings, options); return fs.writeFileSync(location, settings, options);
} }
catch (e) { catch (e) {
if (e.code == "EEXIST") { if (e.code == 'EEXIST') {
console.log(`overwriting existing file ${location}`); console.warn(`overwriting existing file ${location}`);
// default flag is 'w' return fs.writeFileSync(location, settings, {
return fs.writeFileSync(location, settings, { encoding: 'utf-8' }); encoding: 'utf-8',
flag: 'w'
});
} }
throw e; throw e;
} }