File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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.' ) ;
You can’t perform that action at this time.
0 commit comments