]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/core-utils.ts
Fix user subscription follows count
[github/Chocobozzz/PeerTube.git] / server / helpers / core-utils.ts
index 7f28cfc8b1306151b7f551459428d64b34637a0d..2cbf0f8fe5eabf19df83ef29a3206063db99a57a 100644 (file)
@@ -164,9 +164,10 @@ let rootPath: string
 function root () {
   if (rootPath) return rootPath
 
-  // We are in /helpers/utils.js
-  rootPath = join(__dirname, '..', '..')
+  rootPath = __dirname
 
+  if (basename(rootPath) === 'helpers') rootPath = resolve(rootPath, '..')
+  if (basename(rootPath) === 'server') rootPath = resolve(rootPath, '..')
   if (basename(rootPath) === 'dist') rootPath = resolve(rootPath, '..')
 
   return rootPath