Skip to content

Commit e82c1dc

Browse files
authored
Merge pull request #31 from keleko34/dev
Issue: api prefix breaks tar install
2 parents 1799338 + 568bcbd commit e82c1dc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ NodePreGypGithub.prototype.init = function() {
3636
if(!this.package_json.binary || 'object' !== typeof this.package_json.binary || 'string' !== typeof this.package_json.binary.host){
3737
throw new Error('Missing binary.host in package.json');
3838
}
39-
else if (this.package_json.binary.host.substr(0, hostPrefix.length) !== hostPrefix){
39+
else if (this.package_json.binary.host.replace('https://','https://api.').substr(0, hostPrefix.length) !== hostPrefix){
4040
throw new Error('binary.host in package.json should begin with: "' + hostPrefix + '"');
4141
}
4242

@@ -87,9 +87,9 @@ NodePreGypGithub.prototype.uploadAsset = function(cfg){
8787
id: this.release.id,
8888
repo: this.repo,
8989
name: cfg.fileName,
90-
file: cfg.filePath,
91-
contentType: mime.contentType(cfg.fileName) || 'application/octet-stream',
92-
contentLength: fs.statSync(cfg.filePath).size,
90+
file: fs.createReadStream(cfg.filePath),
91+
contentType: mime.contentType(cfg.fileName) || 'application/octet-stream',
92+
contentLength: fs.statSync(cfg.filePath).size
9393
}, function(err){
9494
if(err) throw err;
9595
consoleLog('Staged file ' + cfg.fileName + ' saved to ' + this.owner + '/' + this.repo + ' release ' + this.release.tag_name + ' successfully.');

0 commit comments

Comments
 (0)