-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
60 lines (55 loc) · 1.01 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env node
/**
* Emojit.js
* A Command Line Tool to help you write commits using emojis.
*/
'use strict';
var inquirer = require('inquirer');
var exec = require('child_process').exec;
var spawn = require('child_process').spawn;
var emojis = [
{
name: '➕ Adding a feature',
value: ':heavy_plus_sign:'
},
{
name: '➖ Removing a feature',
value: ':heavy_minus_sign:'
},
{
name: '📚 Documentation',
value: ':books:'
},
{
name: '🎨 Design',
value: ':art:'
},
{
name: '⬆ Upgrading dependencies',
value: ':arrow_up:'
},
{
name: '⬇ Downgrading dependencies',
value: ':arrow_down:'
},
{
name: '🎉 Initial commit',
value: ':tada:'
}
]
inquirer.prompt([
{
type: 'list',
name: 'emoji',
message: 'Select emoji:',
choices: emojis
},
{
type: 'input',
name: 'subject',
message: 'Commit message:'
}
]).then(function (answers) {
var commit = answers.emoji + ' ' + answers.subject
spawn('git', ['commit', '-m ' + commit], {stdio: 'inherit'})
});