@@ -5,35 +5,27 @@ module.exports = function( grunt ) {
5
5
grunt . registerMultiTask ( 'build' , 'Runs build files.' , function ( ) {
6
6
var done = this . async ( ) ;
7
7
var target = this . target ;
8
- var files = Array . isArray ( this . file . src ) ? this . file . src : [ this . file . src ] ;
9
- // TODO grunt.file.expandFiles(this.file.src);
10
- var series = files . map ( function ( file ) {
11
- return function ( callback ) {
12
- var options = grunt . config . process ( [ 'build' , target ] ) ;
13
- var args = [ file , options . out || 'dist/' , options . version || 'edge' ] ;
14
- var libraries = Array . isArray ( options . libraries ) ? options . libraries : [ ] ;
15
8
16
- args . push . apply ( args , libraries ) ;
9
+ var options = grunt . config . process ( [ 'build' , target ] ) ;
10
+ var args = [ this . data . src , this . data . out || 'dist/' , this . data . version || 'edge' ] ;
11
+ var libraries = Array . isArray ( this . data . libraries ) ? this . data . libraries : [ ] ;
17
12
18
- grunt . verbose . writeflags ( options , 'Options' ) ;
19
- grunt . log . writeln ( 'Running ./js ' + args . join ( ' ' ) ) ;
13
+ args . push . apply ( args , libraries ) ;
20
14
21
- grunt . utils . exec ( {
22
- cmd : "./js" ,
23
- args : args ,
24
- opts : {
25
- cwd : jsDir
26
- }
27
- } , function ( error , result , code ) {
28
- callback ( error , result , code ) ;
29
- } ) ;
15
+ grunt . verbose . writeflags ( this . data , 'Options' ) ;
16
+ grunt . log . writeln ( 'Running ./js ' + args . join ( ' ' ) ) ;
30
17
31
- grunt . log . write ( "Building " + file + " with Steal...\n" ) ;
18
+ grunt . util . spawn ( {
19
+ cmd : "./js" ,
20
+ args : args ,
21
+ opts : {
22
+ cwd : jsDir
32
23
}
33
- } ) ;
34
- grunt . utils . async . parallel ( series , function ( error , results ) {
24
+ } , function ( error , result , code ) {
35
25
grunt . log . writeln ( 'Done building' ) ;
36
26
done ( ) ;
37
- } )
27
+ } ) ;
28
+
29
+ grunt . log . write ( "Building " + this . data . src + " with Steal...\n" ) ;
38
30
} ) ;
39
31
} ;
0 commit comments