mirror of
https://github.com/desktop/desktop
synced 2024-09-12 21:01:16 +00:00
Nest upload result
This commit is contained in:
parent
0ed1deb643
commit
02679bdc43
|
@ -146,16 +146,13 @@ function upload(assetName: string, assetPath: string) {
|
|||
hash.setEncoding('hex')
|
||||
const input = Fs.createReadStream(assetPath)
|
||||
|
||||
const uploadResult: IUploadResult = {
|
||||
name: assetName,
|
||||
url,
|
||||
size: stats['size'],
|
||||
sha: '',
|
||||
}
|
||||
|
||||
hash.on('finish', () => {
|
||||
uploadResult.sha = hash.read() as string
|
||||
resolve(uploadResult)
|
||||
resolve({
|
||||
name: assetName,
|
||||
url,
|
||||
size: stats['size'],
|
||||
sha: hash.read() as string,
|
||||
})
|
||||
})
|
||||
|
||||
input.pipe(hash)
|
||||
|
|
Loading…
Reference in a new issue