From 26352e20620f927ae2b1c1746d01b1c2e1466fd9 Mon Sep 17 00:00:00 2001 From: Geoff Pleiss and Matt Royal Date: Wed, 17 Jun 2015 15:26:27 -0700 Subject: [PATCH] chore(packaging): add `npm run pui-update` command [Finishes #96481372] --- package.json | 3 ++- scripts/pui-update.js | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 scripts/pui-update.js diff --git a/package.json b/package.json index f4b8f1d2a..6ff10cb79 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/pui-update.js b/scripts/pui-update.js new file mode 100755 index 000000000..4143e6f0f --- /dev/null +++ b/scripts/pui-update.js @@ -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!');