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

Commit

Permalink
chmod bin directory too
Browse files Browse the repository at this point in the history
  • Loading branch information
fent committed May 1, 2014
1 parent c377b4e commit 3d1e88f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions scripts/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function onerr(err) {
}

// First, look for the download link.
/*jshint maxlen:false */
var regexp = /https:\/\/yt-dl\.org\/downloads\/(\d{4}\.\d\d\.\d\d(\.\d)?)\/youtube-dl/;
function getDownloadLink() {
var url = 'http://rg3.github.io/youtube-dl/download.html';
Expand Down Expand Up @@ -61,13 +62,9 @@ function download(link, callback) {
callback(new Error('Response Error: ' + res.statusCode));
}

res.pipe(fs.createWriteStream(filepath));
res.on('end', function() {
// Make file executable.
fs.chmodSync(filepath, 457);
callback(null);
});

fs.chmodSync(dir, 457);
res.pipe(fs.createWriteStream(filepath, { mode: 457 }));
res.on('end', callback);
res.on('error', onerr);
}).on('error', onerr);
}
Expand Down

0 comments on commit 3d1e88f

Please sign in to comment.