* feat(commit.ts): add option to push commits after successful commit

This commit is contained in:
di-sukharev
2023-03-09 21:22:35 +08:00
parent 2b6cc5c360
commit 3892bd0e69
+9
View File
@@ -47,6 +47,15 @@ ${chalk.grey('——————————————————')}`
const { stdout } = await execa('git', ['commit', '-m', commitMessage]);
outro(`${chalk.green('✔')} successfully committed`);
outro(stdout);
const isPushConfirmedByUser = await confirm({
message: 'Do you want to run `git push`?'
});
if (isPushConfirmedByUser) {
const { stdout } = await execa('git', ['push']);
outro(`${chalk.green('✔')} successfully pushed all commits`);
outro(stdout);
}
} else outro(`${chalk.gray('✖')} process cancelled`);
};