Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions bin/cover
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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");
}

Expand Down Expand Up @@ -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");
}

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
}
}
Expand Down
4 changes: 2 additions & 2 deletions contrib/commander.js
Original file line number Diff line number Diff line change
Expand Up @@ -954,15 +954,15 @@ Command.prototype.password = function(str, mask, fn){
mask = '';
}

tty.setRawMode(true);
process.stdin.setRawMode(true);
process.stdout.write(str);

// keypress
process.stdin.on('keypress', function(c, key){
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;
Expand Down