]> source.dussan.org Git - jquery.git/commitdiff
Warn on npm install if Bower isn't installed.
authorScott González <scott.gonzalez@gmail.com>
Sat, 5 Oct 2013 18:28:54 +0000 (14:28 -0400)
committerTimmy Willison <timmywillisn@gmail.com>
Mon, 7 Oct 2013 21:17:04 +0000 (17:17 -0400)
build/bower-install.js [new file with mode: 0644]
package.json

diff --git a/build/bower-install.js b/build/bower-install.js
new file mode 100644 (file)
index 0000000..fefcfc0
--- /dev/null
@@ -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 );
+});
index 113d29082b6f43cdd5007d5d3d59f7631b18c66f..6da6ab4f543c0b60e34c8498e27cf1d96ca82c78 100644 (file)
@@ -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",