mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Warn on npm install if Bower isn't installed.
This commit is contained in:
parent
d1f247daf8
commit
4d818ab12c
23
build/bower-install.js
Normal file
23
build/bower-install.js
Normal file
@ -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 );
|
||||
});
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user