Skip to content

Commit

Permalink
fix: gitCurrentBranchName should return the branch name not a process…
Browse files Browse the repository at this point in the history
… result object
  • Loading branch information
6pac committed Oct 9, 2022
1 parent 6dd4649 commit b25be57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions scripts/git-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ function gitCommit(commitMsg, { cwd, dryRun }) {
* @param {{ cwd: String, dryRun: Boolean}} options
* @returns {Promise<any>}
*/
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;
}

/**
Expand Down
7 changes: 5 additions & 2 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -74,7 +77,7 @@ const cwd = process.cwd();
versionIncrements,
defaultIndex = versionIncrements.length - 1
);

if (whichBumpType !== 'quit') {
let newVersion = '';
if (whichBumpType === 'other') {
Expand Down Expand Up @@ -238,7 +241,7 @@ function getConsoleInput(promptText) {
rl.close();
resolve(ans);
}))
}
}

/**
* Simple function to select an item from a passed list of choices
Expand Down

0 comments on commit b25be57

Please sign in to comment.