Return after rejection.

This commit is contained in:
Daniel Scalzi 2020-09-13 02:22:24 -04:00
parent 2156099ea8
commit 17e36fa5a2
No known key found for this signature in database
GPG Key ID: D18EA3FB4B142A57

View File

@ -551,17 +551,21 @@ exports.pullRemote = function(){
data = DistroIndex.fromJSON(JSON.parse(body)) data = DistroIndex.fromJSON(JSON.parse(body))
} catch (e) { } catch (e) {
reject(e) reject(e)
return
} }
fs.writeFile(distroDest, body, 'utf-8', (err) => { fs.writeFile(distroDest, body, 'utf-8', (err) => {
if(!err){ if(!err){
resolve(data) resolve(data)
return
} else { } else {
reject(err) reject(err)
return
} }
}) })
} else { } else {
reject(error) reject(error)
return
} }
}) })
}) })
@ -576,8 +580,10 @@ exports.pullLocal = function(){
if(!err){ if(!err){
data = DistroIndex.fromJSON(JSON.parse(d)) data = DistroIndex.fromJSON(JSON.parse(d))
resolve(data) resolve(data)
return
} else { } else {
reject(err) reject(err)
return
} }
}) })
}) })