File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -297,18 +297,29 @@ module.exports = function(grunt) {
297
297
// done();
298
298
// });
299
299
// });
300
-
300
+
301
+ // Create the bower.json file
301
302
grunt . registerTask ( 'update-bower-json' , function ( ) {
302
303
var currentTag = semver . clean ( util . getCurrentTag ( ) ) ;
303
- var jsonFile = path . resolve ( process . cwd ( ) ) + '/dist/release/' + currentTag + '/bower.json' ;
304
+
305
+ var taggedReleaseDir = path . join ( path . resolve ( process . cwd ( ) ) , 'dist' , 'release' , currentTag ) ;
306
+
307
+ // Get the list of files from the release directory
308
+ var releaseFiles = fs . readdirSync ( taggedReleaseDir )
309
+ // Filter out minified files and the bower.json file, if it's there already
310
+ . filter ( function ( f ) { return ! / \. m i n \. / . test ( f ) && ! / ^ b o w e r \. j s o n $ / . test ( f ) ; } )
311
+ // Preprend "./" to each file path
312
+ . map ( function ( f ) { return './' + f ; } ) ;
313
+
314
+ var jsonFile = path . join ( taggedReleaseDir , 'bower.json' ) ;
304
315
305
316
var json = {
306
317
"name" : "angular-ui-grid" ,
307
318
"version" : currentTag ,
308
- "main" : "./ui-grid.js" ,
319
+ "main" : releaseFiles ,
309
320
"ignore" : [ ] ,
310
321
"dependencies" : {
311
- "angular" : ">= 1.2.16"
322
+ "angular" : "~ 1.2.16"
312
323
} ,
313
324
"homepage" : "http://ui-grid.info"
314
325
} ;
You can’t perform that action at this time.
0 commit comments