Skip to content

Commit

Permalink
chore(packaging): add npm run pui-update command
Browse files Browse the repository at this point in the history
[Finishes #96481372]
  • Loading branch information
matt-royal committed Jun 17, 2015
1 parent 2ad8df1 commit 26352e2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"pui-react-typography": "^0.1.0"
},
"scripts": {
"test": "node_modules/gulp/bin/gulp.js ci --fatal"
"test": "gulp ci --fatal",
"pui-update": "scripts/pui-update.js"
},
"repository": {
"type": "git",
Expand Down
20 changes: 20 additions & 0 deletions scripts/pui-update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /usr/bin/env node

var fs = require('fs');
var exec = require('child_process').execSync;

var packageJson = JSON.parse(fs.readFileSync('./package.json'));
var allDependencies = Array.prototype.concat.call(
Object.keys(packageJson.dependencies),
Object.keys(packageJson.devDependencies)
);
var puiDependencies = allDependencies.filter(function(dependency) {
return (dependency.match(/pui-css-/) || dependency.match(/pui-react-/));
});

puiDependencies.forEach(function(dependency) {
console.log('Updating ' + dependency + '...');
exec('npm update ' + dependency);
});

console.log('Done!');

0 comments on commit 26352e2

Please sign in to comment.