diff --git a/packages/automatic-versioning/src/index.js b/packages/automatic-versioning/src/index.js index 6e255e3..607988b 100644 --- a/packages/automatic-versioning/src/index.js +++ b/packages/automatic-versioning/src/index.js @@ -39,7 +39,7 @@ const defaultRootDir = "../../../../"; opts.root ??= defaultRootDir; opts.ignorePrefixes = opts.ignorePrefixes?.split(",") ?? []; -console.log(`Running versioning script for ${opts.name}`.green); +console.info(`Running versioning script for ${opts.name}`.green); if (opts.root !== defaultRootDir) { const parentDir = path.resolve(__dirname, opts.root); diff --git a/packages/automatic-versioning/src/types/default.js b/packages/automatic-versioning/src/types/default.js index 3f43dcd..4724081 100644 --- a/packages/automatic-versioning/src/types/default.js +++ b/packages/automatic-versioning/src/types/default.js @@ -22,7 +22,7 @@ const getCommitPrefix = async (recursive, ignorePrefixes, n = 1) => { const runner = (name, noCommit, recursive = false, prereleaseTag, prereleaseBranch, ignorePrefixes) => { run("git show --first-parent ./").then(async (diff) => { if (diff) { - console.log(`Diff found, running versioning for ${name}`.green); + console.info(`Diff found, running versioning for ${name}`.green); const { commitMessage, commitPrefix, noBump } = await getCommitPrefix(recursive, ignorePrefixes); if (!noBump) { let versionUpdate; @@ -35,7 +35,7 @@ const runner = (name, noCommit, recursive = false, prereleaseTag, prereleaseBran } else if (["prerelease", "prepatch", "preminor", "premajor"].includes(commitPrefix)) { versionUpdate = commitPrefix; } else { - console.log(`No suitable commit prefix found in commit message, skipping version bump`.yellow); + console.info(`No suitable commit prefix found in commit message, skipping version bump`.yellow); return; } if (prereleaseBranch && ["major", "minor", "patch"].includes(versionUpdate)) { @@ -84,19 +84,19 @@ const runner = (name, noCommit, recursive = false, prereleaseTag, prereleaseBran }"`; run("git add .").then(() => { run(`git commit -m ${successMsg} --no-verify`).then(() => { - console.log(successMsg.green); + console.info(successMsg.green); }); }); } }); } else { - console.log(`No bump found in commit message, skipping version bump and editing commit message`.yellow); + console.info(`No bump found in commit message, skipping version bump and editing commit message`.yellow); run(`git commit --amend -m "${commitMessage.replace(/--no-bump/g, "")}"`).then(() => { - console.log("Successfully edited commit message".green); + console.info("Successfully edited commit message".green); }); } } else { - console.log(`No diff found, skipping version bump for ${name}`.yellow); + console.info(`No diff found, skipping version bump for ${name}`.yellow); } }); }; diff --git a/packages/automatic-versioning/src/types/tag-based.js b/packages/automatic-versioning/src/types/tag-based.js index 55d0f73..3b792ad 100644 --- a/packages/automatic-versioning/src/types/tag-based.js +++ b/packages/automatic-versioning/src/types/tag-based.js @@ -18,14 +18,14 @@ const runner = (name, noCommit) => { const successMsg = `"CI: Bumped version of ${name} from ${initialVersion} to ${latest}"`; run("git add .").then(() => { run(`git commit -m ${successMsg}`).then(() => { - console.log(successMsg.green); + console.info(successMsg.green); }); }); } }) .catch(() => {}); } else { - console.log(`No tag diff found, skipping version bump for ${name}`.yellow); + console.info(`No tag diff found, skipping version bump for ${name}`.yellow); } }); }); diff --git a/packages/automatic-versioning/src/utils/runner.js b/packages/automatic-versioning/src/utils/runner.js index 70c6299..f7bf226 100644 --- a/packages/automatic-versioning/src/utils/runner.js +++ b/packages/automatic-versioning/src/utils/runner.js @@ -17,7 +17,7 @@ const executor = (command) => { return resolve(output); }) .catch((error) => { - if (error) console.log(error.red); + if (error) console.error(error.red); return reject(error); }); });