Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed express(1) ENOENT reference for 0.3.x. Closes #524
  • Loading branch information
tj committed Feb 7, 2011
1 parent 8c3ad12 commit 51a4881
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bin/express
Expand Up @@ -8,6 +8,16 @@ var fs = require('fs')
, sys = require('sys')
, exec = require('child_process').exec;

/**
* COMPAT: constants
*/

try {
var constants = require('constants');
} catch (err) {
var constants = process;
}

/**
* Framework version.
*/
Expand Down Expand Up @@ -352,7 +362,7 @@ function createApplicationAt(path) {

function emptyDirectory(path, fn) {
fs.readdir(path, function(err, files){
if (err && err.errno !== process.ENOENT) throw err;
if (err && err.errno !== constants.ENOENT) throw err;
fn(!files || !files.length);
});
}
Expand Down

0 comments on commit 51a4881

Please sign in to comment.