Commit 0e2fd7e Contra
committed
1 parent a52a450 commit 0e2fd7e Copy full SHA for 0e2fd7e
File tree 2 files changed +25
-24
lines changed
2 files changed +25
-24
lines changed Original file line number Diff line number Diff line change @@ -6,27 +6,28 @@ var util = require('util');
6
6
var Orchestrator = require ( 'orchestrator' ) ;
7
7
var chalk = require ( 'chalk' ) ;
8
8
9
+ // format orchestrator errors
10
+ var formatError = function ( e ) {
11
+ if ( ! e . err ) return e . message ;
12
+ if ( e . err . message ) return e . err . message ;
13
+ return JSON . stringify ( e . err ) ;
14
+ } ;
15
+
9
16
function Gulp ( ) {
10
17
Orchestrator . call ( this ) ;
11
18
this . env = { } ;
19
+
20
+ // Logging
12
21
this . on ( 'task_start' , function ( e ) {
13
22
gulp . log ( 'Running' , "'" + chalk . cyan ( e . task ) + "'..." ) ;
14
23
} ) ;
15
24
this . on ( 'task_stop' , function ( e ) {
16
- gulp . log ( 'Finished' , "'" + chalk . cyan ( e . task ) + "' in " + e . duration + " seconds" ) ;
25
+ gulp . log ( 'Finished' , "'" + chalk . cyan ( e . task ) + "' in " + chalk . magenta ( e . duration ) + " seconds" ) ;
17
26
} ) ;
27
+
18
28
this . on ( 'task_err' , function ( e ) {
19
- var mess ;
20
- if ( e . err ) {
21
- if ( e . err . message ) {
22
- mess = e . err . message ;
23
- } else {
24
- mess = JSON . stringify ( e . err ) ;
25
- }
26
- } else {
27
- mess = e . message ;
28
- }
29
- gulp . log ( 'Errored' , "'" + chalk . cyan ( e . task ) + "' in " + e . duration + " seconds " + chalk . red ( mess ) + ' ' ) ;
29
+ var msg = formatError ( e ) ;
30
+ gulp . log ( 'Errored' , "'" + chalk . cyan ( e . task ) + "' in " + chalk . magenta ( e . duration ) + " seconds " + chalk . red ( msg ) ) ;
30
31
} ) ;
31
32
}
32
33
util . inherits ( Gulp , Orchestrator ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" :" gulp" ,
3
3
"description" :" The streaming build system" ,
4
- "version" :" 2.4.1 " ,
4
+ "version" :" 2.5.0 " ,
5
5
"homepage" :" http://github.com/wearefractal/gulp" ,
6
6
"repository" :" git://github.com/wearefractal/gulp.git" ,
7
7
"author" :
" Fractal <[email protected] > (http://wearefractal.com/)" ,
13
13
"gulp" :" ./bin/gulp.js"
14
14
},
15
15
"dependencies" :{
16
- "event-stream" :" 3.0.16 " ,
17
- "glob-stream" :" 0.1.0 " ,
18
- "mkdirp" :" 0.3.5 " ,
19
- "optimist" :" 0.6.0 " ,
20
- "gulp-util" :" 1.0.0 " ,
21
- "gaze" :" 0.4.3 " ,
22
- "orchestrator" : " 0.1.0 " ,
23
- "chalk" :" 0.3.0 " ,
24
- "resolve" :" 0.5.1 " ,
25
- "semver" :" 2.2.1 " ,
26
- "findup-sync" :" 0.1.2 "
16
+ "event-stream" :" 3.0.x " ,
17
+ "glob-stream" :" 0.1.x " ,
18
+ "mkdirp" :" 0.3.x " ,
19
+ "optimist" :" 0.6.x " ,
20
+ "gulp-util" :" 1.0.x " ,
21
+ "gaze" :" 0.4.x " ,
22
+ "orchestrator" : " 0.1.x " ,
23
+ "chalk" :" 0.3.x " ,
24
+ "resolve" :" 0.6.x " ,
25
+ "semver" :" 2.2.x " ,
26
+ "findup-sync" :" 0.1.x "
27
27
},
28
28
"devDependencies" :{
29
29
"mocha" :" *" ,
You can’t perform that action at this time.
0 commit comments