Use async series in installer for better readability
This commit is contained in:
parent
1cad0f395f
commit
cefc718dd6
1 changed files with 14 additions and 12 deletions
|
@ -16,21 +16,23 @@ const installer = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function installApplication (callback) {
|
function installApplication (callback) {
|
||||||
// Creates directories
|
async.series([
|
||||||
createDirectoriesIfNotExist(function (err) {
|
function createDirectories (callbackAsync) {
|
||||||
if (err) return callback(err)
|
createDirectoriesIfNotExist(callbackAsync)
|
||||||
|
},
|
||||||
|
|
||||||
// ----------- Create the certificates if they don't already exist -----------
|
function createCertificates (callbackAsync) {
|
||||||
peertubeCrypto.createCertsIfNotExist(function (err) {
|
peertubeCrypto.createCertsIfNotExist(callbackAsync)
|
||||||
if (err) return callback(err)
|
},
|
||||||
|
|
||||||
createOAuthClientIfNotExist(function (err) {
|
function createOAuthClient (callbackAsync) {
|
||||||
if (err) return callback(err)
|
createOAuthClientIfNotExist(callbackAsync)
|
||||||
|
},
|
||||||
|
|
||||||
createOAuthUserIfNotExist(callback)
|
function createOAuthUser (callbackAsync) {
|
||||||
})
|
createOAuthUserIfNotExist(callbackAsync)
|
||||||
})
|
}
|
||||||
})
|
], callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue