Commit b8a0027e authored by Bryan Clark's avatar Bryan Clark
Browse files

Use console.log where appropriate

parent 24327359
Loading
Loading
Loading
Loading
+3 −3
Changes for lib/auth.js: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -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);
    });
}
+1 −1
Changes for lib/setup-java.js: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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) {
+5 −3
Changes for src/auth.ts: 5 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -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);
}