@@ -6,6 +6,7 @@ var gulp = require('gulp');
6
6
var git = require ( 'gulp-git' ) ;
7
7
var process = require ( 'process' ) ;
8
8
var minimist = require ( 'minimist' ) ;
9
+ var child_process = require ( 'child_process' ) ;
9
10
10
11
exports . init = function ( rawGitArgs , environment , config ) {
11
12
if ( typeof environment === 'undefined' ) {
@@ -63,20 +64,14 @@ function withoutConfig(rawGitArgs, environment) {
63
64
if ( environment . debug === true ) {
64
65
console . error ( 'COMMITIZEN DEBUG: No git-cz friendly config was detected. I looked for .czrc, .cz.json, or czConfig in package.json.' ) ;
65
66
} else {
66
- // Get a gulp stream based off the config
67
- gulp . src ( process . cwd ( ) )
67
+ var vanillaGitArgs = [ "commit" ] . concat ( rawGitArgs ) ;
68
68
69
- // Format then commit
70
- . pipe ( git . commit ( undefined , { args : rawGitArgs , disableMessageRequirement : true } ) )
71
-
72
- // Handle commit success
73
- . on ( 'end' , function ( ) {
74
- console . log ( '✓ Commit succeeded.' ) ;
75
- } )
69
+ var child = child_process . spawn ( 'git' , vanillaGitArgs , {
70
+ stdio : 'inherit'
71
+ } ) ;
76
72
77
- // Handle commit failure
78
- . on ( 'error' , function ( error ) {
79
- console . error ( '✗ Commit failed. Did you forget to \'git add\' your files or add a commit message?' ) ;
73
+ child . on ( 'error' , function ( e , code ) {
74
+ console . error ( e ) ;
80
75
} ) ;
81
76
}
82
77
}
0 commit comments