]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/core-utils.ts
Fix bad translation in confirm dialog
[github/Chocobozzz/PeerTube.git] / server / helpers / core-utils.ts
index f8dd45533f352a05c6f85e2c0de3948e3dd9d3a3..2ec7e6515fc82982e573d29e08438436b709e7e1 100644 (file)
@@ -25,8 +25,15 @@ function isTestInstance () {
 }
 
 function root () {
-  // We are in /dist/helpers/utils.js
-  return join(__dirname, '..', '..', '..')
+  // We are in /helpers/utils.js
+  const paths = [ __dirname, '..', '..' ]
+
+  // We are under /dist directory
+  if (process.mainModule.filename.endsWith('.ts') === false) {
+    paths.push('..')
+  }
+
+  return join.apply(null, paths)
 }
 
 function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> {