aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-10-05 14:28:54 -0400
committerTimmy Willison <timmywillisn@gmail.com>2013-10-07 17:17:04 -0400
commit4d818ab12c53a24bb9dc989cff395ec2d090bd5c (patch)
treef454244d5a332c614bb1a4dc8739cead027d054e
parentd1f247daf82e9b123690f8f51c7b3d1818bccbfe (diff)
downloadjquery-4d818ab12c53a24bb9dc989cff395ec2d090bd5c.tar.gz
jquery-4d818ab12c53a24bb9dc989cff395ec2d090bd5c.zip
Warn on npm install if Bower isn't installed.
-rw-r--r--build/bower-install.js23
-rw-r--r--package.json3
2 files changed, 25 insertions, 1 deletions
diff --git a/build/bower-install.js b/build/bower-install.js
new file mode 100644
index 000000000..fefcfc065
--- /dev/null
+++ b/build/bower-install.js
@@ -0,0 +1,23 @@
+var installer,
+ which = require( "which" ),
+ spawn = require( "child_process" ).spawn;
+
+try {
+ which.sync( "bower" );
+} catch( error ) {
+ console.error( "Bower must be installed to build jQuery." );
+ console.error( "Please install Bower by running the following command:" );
+ console.error( "npm install -g bower" );
+ process.exit( 1 );
+}
+
+installer = spawn( "bower", [ "install" ] );
+installer.stdout.on( "data", function( data ) {
+ console.log( data );
+});
+installer.stderr.on( "data", function( data ) {
+ console.error( data );
+});
+installer.on( "close", function( code ) {
+ process.exit( code );
+});
diff --git a/package.json b/package.json
index 113d29082..6da6ab4f5 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,8 @@
"grunt-jsonlint": "~1.0.0",
"gzip-js": "0.3.2",
"testswarm": "~1.1.0",
- "requirejs": "~2.1.8"
+ "requirejs": "~2.1.8",
+ "which": "~1.0.5"
},
"scripts": {
"install": "bower install",