diff --git a/bin/cover b/bin/cover index aab5902..35e2bab 100755 --- a/bin/cover +++ b/bin/cover @@ -67,7 +67,7 @@ // Get the full path relative to the CWD var fullIgnorePath = path.resolve(CWD, ignorePath); - if (path.existsSync(fullIgnorePath)) { + if (fs.existsSync(fullIgnorePath)) { // If we found an ignore file, read it in var ignoreContents = fs.readFileSync(fullIgnorePath, "utf-8"); try { @@ -99,7 +99,7 @@ // Get the full path relative to the CWD configFile = path.resolve(CWD, configFile); - if (!path.existsSync(configFile)) { + if (!fs.existsSync(configFile)) { configFile = defaultConfigPath; } @@ -174,7 +174,7 @@ // Run a file with coverage enabled var runFile = function(file, options, ignore, debug) { - if (!path.existsSync(file)) { + if (!fs.existsSync(file)) { try { file = which(file); } @@ -247,7 +247,7 @@ // Make the directory var dataDirectory = path.join(CWD, configs.dataDirectory); - if (!path.existsSync(dataDirectory)) { + if (!fs.existsSync(dataDirectory)) { fs.mkdirSync(dataDirectory, "0755"); } @@ -297,7 +297,7 @@ // Make the directory var dataDirectory = path.join(CWD, configs.dataDirectory); - if (!path.existsSync(dataDirectory)) { + if (!fs.existsSync(dataDirectory)) { fs.mkdirSync(dataDirectory, "0755"); } @@ -340,7 +340,7 @@ } // If it doesn't exist, then error out - if (!path.existsSync(filename)) { + if (!fs.existsSync(filename)) { console.error("Coverage data file does not exist: " + filename); process.exit(1); } @@ -375,7 +375,7 @@ var datas = []; _.each(files, function(filename) { // If it doesn't exist, then error out - if (!path.existsSync(filename)) { + if (!fs.existsSync(filename)) { console.error("Coverage data file does not exist: " + filename); process.exit(1); } @@ -438,7 +438,7 @@ } // Delete the HTML directory if necessary, and then create it - if (path.existsSync(htmlDirectory)) { + if (fs.existsSync(htmlDirectory)) { rmdirRecursiveSync(htmlDirectory); } fs.mkdirSync(htmlDirectory, "755"); @@ -532,7 +532,7 @@ var run = function(file, cmdline, config, ignore, debug) { if (debug) { var debugDirectory = path.join(CWD, config.debugDirectory); - if (!path.existsSync(debugDirectory)) { + if (!fs.existsSync(debugDirectory)) { fs.mkdirSync(debugDirectory, "0755"); } } diff --git a/contrib/commander.js b/contrib/commander.js index 1a00e97..cf032c8 100644 --- a/contrib/commander.js +++ b/contrib/commander.js @@ -954,7 +954,7 @@ Command.prototype.password = function(str, mask, fn){ mask = ''; } - tty.setRawMode(true); + process.stdin.setRawMode(true); process.stdout.write(str); // keypress @@ -962,7 +962,7 @@ Command.prototype.password = function(str, mask, fn){ if (key && 'enter' == key.name) { console.log(); process.stdin.removeAllListeners('keypress'); - tty.setRawMode(false); + process.stdin.setRawMode(false); if (!buf.trim().length) return self.password(str, mask, fn); fn(buf); return;