Skip to content

Commit

Permalink
Add bowersync script
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Dec 18, 2016
1 parent c670eb2 commit 53a3ea4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"description": "Trend Micro's ESLint config.",
"main": "index.js",
"scripts": {
"bowersync": "./scripts/bowersync",
"lint": "eslint .",
"tests-only": "babel-tape-runner ./test/test-*.js",
"prepublish": "(in-install || eslint-find-rules --unused) && (not-in-publish || npm test) && safe-publish-latest",
"prepublish": "npm run bowersync && (in-install || eslint-find-rules --unused) && (not-in-publish || npm test) && safe-publish-latest",
"pretest": "npm run --silent lint",
"tests-only": "babel-tape-runner ./test/test-*.js",
"test": "npm run --silent tests-only"
},
"repository": {
Expand Down
20 changes: 20 additions & 0 deletions scripts/bowersync
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

var fs = require('fs');
var path = require('path');
var pkg = require('../package.json');
var bower = require('../bower.json');

// Update bower.json
Object.keys(bower).forEach((key) => {
bower[key] = pkg[key] || bower[key];
});
bower.authors = pkg.contributors.map(author => {
return {
name: author.name,
email: author.email,
homepage: author.url
};
});

fs.writeFileSync(path.join(__dirname, '../bower.json'), JSON.stringify(bower, null, 2), 'utf8');

0 comments on commit 53a3ea4

Please sign in to comment.