1
0
Fork 0

Added notice in the event that UglifyJS is unavailable

closure/master
Mike Gerwitz 2011-05-23 18:32:07 -04:00
parent eed9465885
commit b3455abcb9
1 changed files with 22 additions and 4 deletions

View File

@ -6,11 +6,29 @@
*/ */
// uses UglifyJS // uses UglifyJS
var parser = require( 'uglify-js' ).parser, var uglify,
uglify = require( 'uglify-js' ).uglify, FILE_ROOT = '../build/';
FILE_ROOT = '../build/' try
; {
// attempt to load UglifyJS
var uglify = require( 'uglify-js' );
}
catch ( e )
{
// if there's a problem loading it, let the user know what they probably
// need to do
process.stderr.write(
"Unable to located UglifyJS. Please run:\n\n" +
" $ npm install uglify-js\n\n" +
"and then try again.\n"
);
process.exit( 1 );
}
var parser = uglify.parser,
uglify = uglify.uglify;
// we should receive the file via stdin // we should receive the file via stdin
var data = ''; var data = '';