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

Commit

Permalink
ignore any errors after successful download. fixes #43
Browse files Browse the repository at this point in the history
  • Loading branch information
fent committed Sep 23, 2014
1 parent e72b27d commit 58558d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, 484);
}

var success = false;
function onerr(err) {
if (success) { return; }
throw err;
}

Expand Down Expand Up @@ -43,6 +45,7 @@ function getDownloadLink() {
download(m[0], function(err) {
if (err) return onerr(err);
fs.writeFileSync(verpath, newVersion);
success = true;
console.log('Downloaded youtube-dl', newVersion);
});
}
Expand Down

0 comments on commit 58558d8

Please sign in to comment.