Skip to content

Commit 568bcbd

Browse files
committed
fix upload files
1 parent bda252e commit 568bcbd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)