Skip to content

Commit

Permalink
Fix leoforfree#142 & leoforfree#143 from main branch
Browse files Browse the repository at this point in the history
- fix skip confirmCommit
  • Loading branch information
kjvelarde authored Nov 4, 2020
1 parent 65d3646 commit 001d324
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ module.exports = {

const questions = require('./questions').getQuestions(config, cz);

cz.prompt(questions).then(answers => {
cz.prompt(questions).then((answers) => {
if (answers.confirmCommit === 'edit') {
temp.open(null, (err, info) => {
/* istanbul ignore else */
if (!err) {
fs.writeSync(info.fd, buildCommit(answers, config));
fs.close(info.fd, () => {
editor(info.path, code => {
editor(info.path, (code) => {
if (code === 0) {
const commitStr = fs.readFileSync(info.path, {
encoding: 'utf8',
Expand All @@ -73,7 +73,7 @@ module.exports = {
});
}
});
} else if (answers.confirmCommit === 'yes') {
} else if (!answers.confirmCommit || answers.confirmCommit === 'yes') {
commit(buildCommit(answers, config));
} else {
log.info('Commit has been canceled.');
Expand Down

0 comments on commit 001d324

Please sign in to comment.