Skip to content
Browse files

use `fs.exists`

  • Loading branch information...
1 parent 1e3c85e commit 658c65133d5904685d404e3157828f9f316afa98 @fent fent committed Jul 4, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/youtube-dl.js
View
7 lib/youtube-dl.js
@@ -1,6 +1,9 @@
var spawn = require('child_process').spawn
, EventEmitter = require('events').EventEmitter
+ , fs = require('fs')
, path = require('path')
+ , exists = fs.exists || path.exists
+ ;
// arguments we dont want users to use with youtube-dl
@@ -33,11 +36,11 @@ var parseOpts = function(args) {
// check that youtube-dl file exists
var file = path.join(__dirname, '..', 'bin', 'youtube-dl');
-path.exists(file, function(exists) {
+exists(file, function(exists) {
if (exists) return;
require(__dirname + '/../scripts/download');
- path.exists(file, function(exists) {
+ exists(file, function(exists) {
if (!exists) {
throw new Error('youtube-dl file does not exist. tried to download it but failed.');
}

0 comments on commit 658c651

Please sign in to comment.
Something went wrong with that request. Please try again.