Skip to content

Commit 6bd917a

Browse files
committed
fix(bower): Use right angular version spec
Also include full list of "release" files in "main" specification in bower.json
1 parent 78583df commit 6bd917a

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

lib/grunt/plugins.js

+15-4
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,29 @@ module.exports = function(grunt) {
297297
// done();
298298
// });
299299
// });
300-
300+
301+
// Create the bower.json file
301302
grunt.registerTask('update-bower-json', function () {
302303
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 !/\.min\./.test(f) && !/^bower\.json$/.test(f); })
311+
// Preprend "./" to each file path
312+
.map(function (f) { return './' + f; });
313+
314+
var jsonFile = path.join(taggedReleaseDir, 'bower.json');
304315

305316
var json = {
306317
"name": "angular-ui-grid",
307318
"version": currentTag,
308-
"main": "./ui-grid.js",
319+
"main": releaseFiles,
309320
"ignore": [],
310321
"dependencies": {
311-
"angular": ">= 1.2.16"
322+
"angular": "~1.2.16"
312323
},
313324
"homepage": "http://ui-grid.info"
314325
};

0 commit comments

Comments
 (0)