1
0
Fork 0

Use async series in installer for better readability

This commit is contained in:
Chocobozzz 2016-05-13 21:34:47 +02:00
parent 1cad0f395f
commit cefc718dd6

View file

@ -16,21 +16,23 @@ const installer = {
}
function installApplication (callback) {
// Creates directories
createDirectoriesIfNotExist(function (err) {
if (err) return callback(err)
async.series([
function createDirectories (callbackAsync) {
createDirectoriesIfNotExist(callbackAsync)
},
// ----------- Create the certificates if they don't already exist -----------
peertubeCrypto.createCertsIfNotExist(function (err) {
if (err) return callback(err)
function createCertificates (callbackAsync) {
peertubeCrypto.createCertsIfNotExist(callbackAsync)
},
createOAuthClientIfNotExist(function (err) {
if (err) return callback(err)
function createOAuthClient (callbackAsync) {
createOAuthClientIfNotExist(callbackAsync)
},
createOAuthUserIfNotExist(callback)
})
})
})
function createOAuthUser (callbackAsync) {
createOAuthUserIfNotExist(callbackAsync)
}
], callback)
}
// ---------------------------------------------------------------------------