aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/installer.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-05-13 21:34:47 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-05-13 21:34:47 +0200
commitcefc718dd6b6c0adafbb1e7de122217cffa25cd0 (patch)
tree25cee7714b217e24516666d5193b7ee8814f2c06 /server/initializers/installer.js
parent1cad0f395f928c16d0b36bb72d2e5bbfc81cd760 (diff)
downloadPeerTube-cefc718dd6b6c0adafbb1e7de122217cffa25cd0.tar.gz
PeerTube-cefc718dd6b6c0adafbb1e7de122217cffa25cd0.tar.zst
PeerTube-cefc718dd6b6c0adafbb1e7de122217cffa25cd0.zip
Use async series in installer for better readability
Diffstat (limited to 'server/initializers/installer.js')
-rw-r--r--server/initializers/installer.js32
1 files changed, 17 insertions, 15 deletions
diff --git a/server/initializers/installer.js b/server/initializers/installer.js
index c2f5e47bc..53b07903c 100644
--- a/server/initializers/installer.js
+++ b/server/initializers/installer.js
@@ -16,21 +16,23 @@ const installer = {
16} 16}
17 17
18function installApplication (callback) { 18function installApplication (callback) {
19 // Creates directories 19 async.series([
20 createDirectoriesIfNotExist(function (err) { 20 function createDirectories (callbackAsync) {
21 if (err) return callback(err) 21 createDirectoriesIfNotExist(callbackAsync)
22 22 },
23 // ----------- Create the certificates if they don't already exist ----------- 23
24 peertubeCrypto.createCertsIfNotExist(function (err) { 24 function createCertificates (callbackAsync) {
25 if (err) return callback(err) 25 peertubeCrypto.createCertsIfNotExist(callbackAsync)
26 26 },
27 createOAuthClientIfNotExist(function (err) { 27
28 if (err) return callback(err) 28 function createOAuthClient (callbackAsync) {
29 29 createOAuthClientIfNotExist(callbackAsync)
30 createOAuthUserIfNotExist(callback) 30 },
31 }) 31
32 }) 32 function createOAuthUser (callbackAsync) {
33 }) 33 createOAuthUserIfNotExist(callbackAsync)
34 }
35 ], callback)
34} 36}
35 37
36// --------------------------------------------------------------------------- 38// ---------------------------------------------------------------------------