Skip to content

Commit

Permalink
fix issue ether#281?
Browse files Browse the repository at this point in the history
  • Loading branch information
booo committed Jan 25, 2012
1 parent 9177324 commit 87b1104
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
25 changes: 8 additions & 17 deletions node/utils/Minify.js
Expand Up @@ -28,7 +28,7 @@ var jsp = require("uglify-js").parser;
var pro = require("uglify-js").uglify;
var path = require('path');
var Buffer = require('buffer').Buffer;
var gzip = require('gzip');
var zlib = require('zlib');
var RequireKernel = require('require-kernel');
var server = require('../server');
var os = require('os');
Expand Down Expand Up @@ -233,23 +233,14 @@ function _handle(req, res, jsFilename, jsFiles) {
//write the results compressed in a file
function(callback)
{
//spawn a gzip process if we're on a unix system
if(os.type().indexOf("Windows") == -1)
{
gzip(result, 9, function(err, compressedResult){
//weird gzip bug that returns 0 instead of null if everything is ok
err = err === 0 ? null : err;
zlib.gzip(result, function(err, compressedResult){
//weird gzip bug that returns 0 instead of null if everything is ok
err = err === 0 ? null : err;

if(ERR(err, callback)) return;

if(ERR(err, callback)) return;

fs.writeFile(CACHE_DIR + "minified_" + jsFilename + ".gz", compressedResult, callback);
});
}
//skip this step on windows
else
{
callback();
}
fs.writeFile(CACHE_DIR + "minified_" + jsFilename + ".gz", compressedResult, callback);
});
}
],callback);
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -18,7 +18,6 @@
"express" : "2.5.0",
"clean-css" : "0.2.4",
"uglify-js" : "1.1.1",
"gzip" : "0.1.0",
"formidable" : "1.0.7",
"log4js" : "0.3.9",
"jsdom-nocontextifiy" : "0.2.10",
Expand Down

0 comments on commit 87b1104

Please sign in to comment.