From b8a0027e2cdcd55e80a1bd0c14f91d9e18a4273e Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 12:54:29 -0800 Subject: [PATCH] Use console.log where appropriate --- lib/auth.js | 6 +++--- lib/setup-java.js | 2 +- src/auth.ts | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/auth.js b/lib/auth.js index 9b03d1cd..f8d795a7 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -25,14 +25,14 @@ exports.SETTINGS_FILE = 'settings.xml'; function configAuthentication(id, username, password) { return __awaiter(this, void 0, void 0, function* () { if (id && username && password) { - core.debug(`configAuthentication with ${username} and a password`); + console.log(`creating ${exports.SETTINGS_FILE} with server-id: ${id}, username: ${username}, and a password`); const directory = path.join(os.homedir(), exports.M2_DIR); yield io.mkdirP(directory); core.debug(`created directory ${directory}`); yield write(directory, generate(id, username, password)); } else { - core.debug(`no auth without username: ${username} and password: ${password}`); + core.debug(`no ${exports.SETTINGS_FILE} without server-id: ${id}, username: ${username}, and a password`); } }); } @@ -56,7 +56,7 @@ function write(directory, settings) { return __awaiter(this, void 0, void 0, function* () { const options = { encoding: 'utf-8' }; const location = path.join(directory, exports.SETTINGS_FILE); - core.debug(`writing ${location}`); + console.log(`writing ${location}`); return fs.writeFileSync(location, settings, options); }); } diff --git a/lib/setup-java.js b/lib/setup-java.js index ce1e3760..5372cbb6 100644 --- a/lib/setup-java.js +++ b/lib/setup-java.js @@ -31,7 +31,7 @@ function run() { yield installer.getJava(version, arch, jdkFile); const matchersPath = path.join(__dirname, '..', '.github'); console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); - const id = core.getInput('id', { required: false }); + const id = core.getInput('server-id', { required: false }); const username = core.getInput('username', { required: false }); const password = core.getInput('password', { required: false }); if (id && username && password) { diff --git a/src/auth.ts b/src/auth.ts index 4979045c..b61b357d 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -13,14 +13,16 @@ export async function configAuthentication( password: string ) { if (id && username && password) { - core.debug(`configAuthentication with ${username} and a password`); + console.log( + `creating ${SETTINGS_FILE} with server-id: ${id}, username: ${username}, and a password` + ); const directory: string = path.join(os.homedir(), M2_DIR); await io.mkdirP(directory); core.debug(`created directory ${directory}`); await write(directory, generate(id, username, password)); } else { core.debug( - `no auth without username: ${username} and password: ${password}` + `no ${SETTINGS_FILE} without server-id: ${id}, username: ${username}, and a password` ); } } @@ -43,6 +45,6 @@ export function generate(id: string, username: string, password: string) { async function write(directory: string, settings: string) { const options = {encoding: 'utf-8'}; const location = path.join(directory, SETTINGS_FILE); - core.debug(`writing ${location}`); + console.log(`writing ${location}`); return fs.writeFileSync(location, settings, options); }