+26
-3
@@ -1,3 +0,3 @@ | ||
| const Git = require('simple-git')(); | ||
| const { Select, Input } = require('enquirer'); | ||
| const Git = require('simple-git/promise')(); | ||
| const { Select, Input, Confirm } = require('enquirer'); | ||
| const config = require('./config'); | ||
@@ -58,2 +58,7 @@ const fs = require('fs'); | ||
| const promptPushToGit = new Confirm({ | ||
| name: 'question', | ||
| message: 'Would you like to push to remote (current branch)?', | ||
| }); | ||
| const getRandomEmoji = () => { | ||
@@ -78,3 +83,21 @@ const randIndex = Math.floor(Math.random() * config.emojiPool.length); | ||
| Git.commit(`${emoji} ${message}`); | ||
| console.log('✅ Success! You can now git push!'); | ||
| promptPushToGit.run() | ||
| .then(isPush => { | ||
| if (isPush) { | ||
| console.log('📡 Pushing to remote...'); | ||
| Git.push('origin', 'HEAD') | ||
| .then(() => { | ||
| console.log('✅ Succesfully pushed to remote!'); | ||
| }) | ||
| .catch(() => { | ||
| console.log('👎 Push to remote failed.'); | ||
| }); | ||
| } else { | ||
| console.log('✅ Commit success!'); | ||
| } | ||
| }) | ||
| .catch(onCancel); | ||
| }) | ||
@@ -81,0 +104,0 @@ .catch(onCancel); |
+1
-1
| { | ||
| "name": "gimmit", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "Git commit but cuter", | ||
@@ -5,0 +5,0 @@ "main": "gimmit.js", |
51110
1.27%155
13.97%