From 3892bd0e6949cac1cd36e6fee808df97c0caa245 Mon Sep 17 00:00:00 2001 From: di-sukharev Date: Thu, 9 Mar 2023 21:22:35 +0800 Subject: [PATCH] * feat(commit.ts): add option to push commits after successful commit --- src/commands/commit.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/commands/commit.ts b/src/commands/commit.ts index eccd9b3..72e840f 100644 --- a/src/commands/commit.ts +++ b/src/commands/commit.ts @@ -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`); };