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

Commit

Permalink
check for datadir existence
Browse files Browse the repository at this point in the history
  • Loading branch information
przemyslawpluta committed Mar 8, 2016
1 parent b9992cf commit 1817160
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ function downloader(binDir, callback) {

createBase(binDir);

var ytdlBinary = fs.readFileSync(dataPath + '/bin').toString();

var exists = fs.existsSync(ytdlBinary);

request.get(url, function get(err, res, body) {

if (err || res.statusCode !== 200) { return callback(err || new Error('Response Error: ' + res.statusCode)); }
Expand All @@ -73,7 +69,7 @@ function downloader(binDir, callback) {
var verpath = path.join(dir, 'version');
var oldVersion = fs.existsSync(verpath) && fs.readFileSync(verpath, 'utf8');

if (newVersion === oldVersion && exists) { return callback(null, 'Already up to date ' + newVersion); }
if (newVersion === oldVersion && fs.existsSync(dataPath + '/bin')) { return callback(null, 'Already up to date ' + newVersion); }

var link = m[0];
if (isWin) { link += '.exe'; }
Expand Down

0 comments on commit 1817160

Please sign in to comment.