Compare commits

..

6 Commits

Author SHA1 Message Date
di-sukharev
5a0a384cbe 1.0.6 2023-03-09 21:25:49 +08:00
di-sukharev
a8839353f7 * chore(commit.ts): add spinner to indicate git push process
* refactor(commit.ts): change success message to include spinner in `git push` process
2023-03-09 21:25:38 +08:00
di-sukharev
88006b8693 * fix(commit.ts): add check for cancelation of git push confirmation prompt 2023-03-09 21:23:58 +08:00
di-sukharev
5d9d1c972a 1.0.5 2023-03-09 21:22:46 +08:00
di-sukharev
3892bd0e69 * feat(commit.ts): add option to push commits after successful commit 2023-03-09 21:22:35 +08:00
di-sukharev
2b6cc5c360 * chore(README.md): update example section to clarify that all commits in the repo are done with OpenCommit 2023-03-09 21:20:17 +08:00
4 changed files with 15 additions and 4 deletions

View File

@@ -13,7 +13,7 @@
## Examples
Look into [the commits](https://github.com/di-sukharev/opencommit/commit/eae7618d575ee8d2e9fff5de56da79d40c4bc5fc) to see how OpenCommit works. Emoji and long commit description text is configurable.
All the commits in this repo are done with OpenCommit — look into [the commits](https://github.com/di-sukharev/opencommit/commit/eae7618d575ee8d2e9fff5de56da79d40c4bc5fc) to see how OpenCommit works. Emoji and long commit description text is configurable.
## Setup

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "open-commit",
"version": "1.0.4",
"version": "1.0.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "open-commit",
"version": "1.0.4",
"version": "1.0.6",
"license": "ISC",
"dependencies": {
"@clack/prompts": "^0.6.1",

View File

@@ -1,6 +1,6 @@
{
"name": "opencommit",
"version": "1.0.4",
"version": "1.0.6",
"description": "AI generates conventional commits with mind-blowing accuracy.",
"keywords": [
"git",

View File

@@ -47,6 +47,17 @@ ${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 && !isCancel(isPushConfirmedByUser)) {
const pushSpinner = spinner();
pushSpinner.start('Running `git push`');
const { stdout } = await execa('git', ['push']);
pushSpinner.stop(`${chalk.green('✔')} successfully pushed all commits`);
outro(stdout);
}
} else outro(`${chalk.gray('✖')} process cancelled`);
};