Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
update exists method
Browse files Browse the repository at this point in the history
  • Loading branch information
fent committed Mar 22, 2013
1 parent 73e93d1 commit 1fbfb00
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var spawn = require('child_process').spawn
, EventEmitter = require('events').EventEmitter
, fs = require('fs')
, path = require('path')
, exists = fs.exists || path.exists
, split = require('event-stream').split
;

Expand Down Expand Up @@ -38,11 +37,11 @@ var parseOpts = function(args) {

// check that youtube-dl file exists
var file = path.join(__dirname, '..', 'bin', 'youtube-dl');
exists(file, function(exists) {
fs.exists(file, function(exists) {
if (exists) return;

require(__dirname + '/../scripts/download');
exists(file, function(exists) {
fs.exists(file, function(exists) {
if (!exists) {
throw new Error('youtube-dl file does not exist. tried to download it but failed.');
}
Expand Down

0 comments on commit 1fbfb00

Please sign in to comment.