]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/installer.js
Add check for the author username length
[github/Chocobozzz/PeerTube.git] / server / initializers / installer.js
index c2f5e47bc82fab1592190a3cb54de00c444b8a7b..53b07903c3b46af6a1cc1f5170e35f82c9d1f026 100644 (file)
@@ -16,21 +16,23 @@ const installer = {
 }
 
 function installApplication (callback) {
-  // Creates directories
-  createDirectoriesIfNotExist(function (err) {
-    if (err) return callback(err)
-
-    // ----------- Create the certificates if they don't already exist -----------
-    peertubeCrypto.createCertsIfNotExist(function (err) {
-      if (err) return callback(err)
-
-      createOAuthClientIfNotExist(function (err) {
-        if (err) return callback(err)
-
-        createOAuthUserIfNotExist(callback)
-      })
-    })
-  })
+  async.series([
+    function createDirectories (callbackAsync) {
+      createDirectoriesIfNotExist(callbackAsync)
+    },
+
+    function createCertificates (callbackAsync) {
+      peertubeCrypto.createCertsIfNotExist(callbackAsync)
+    },
+
+    function createOAuthClient (callbackAsync) {
+      createOAuthClientIfNotExist(callbackAsync)
+    },
+
+    function createOAuthUser (callbackAsync) {
+      createOAuthUserIfNotExist(callbackAsync)
+    }
+  ], callback)
 }
 
 // ---------------------------------------------------------------------------