From b25be57ed6880ec30adec1541d829069db4c86ef Mon Sep 17 00:00:00 2001 From: Ben McIntyre Date: Sun, 9 Oct 2022 15:56:25 +0930 Subject: [PATCH] fix: gitCurrentBranchName should return the branch name not a process result object --- scripts/git-utils.js | 5 +++-- scripts/release.js | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/git-utils.js b/scripts/git-utils.js index d0e19ba3..9a67c152 100644 --- a/scripts/git-utils.js +++ b/scripts/git-utils.js @@ -25,9 +25,10 @@ function gitCommit(commitMsg, { cwd, dryRun }) { * @param {{ cwd: String, dryRun: Boolean}} options * @returns {Promise} */ -function gitCurrentBranchName({ cwd }) { +async function gitCurrentBranchName({ cwd }) { const execArgs = ['branch', '--show-current']; - return childProcess.exec('git', execArgs, { cwd }); + const procRtn = await childProcess.exec('git', execArgs, { cwd }); + return procRtn.stdout; } /** diff --git a/scripts/release.js b/scripts/release.js index fe011d7c..8065733c 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -20,6 +20,9 @@ const argv = yargs.argv; const options = argv; const cwd = process.cwd(); +const childProcess = require('./child-process.js'); + + /** * Main entry, this script will execute the following steps * 1. Ask for version bump type @@ -74,7 +77,7 @@ const cwd = process.cwd(); versionIncrements, defaultIndex = versionIncrements.length - 1 ); - + if (whichBumpType !== 'quit') { let newVersion = ''; if (whichBumpType === 'other') { @@ -238,7 +241,7 @@ function getConsoleInput(promptText) { rl.close(); resolve(ans); })) -} +} /** * Simple function to select an item from a passed list of choices