diff options
Diffstat (limited to 'server/helpers/core-utils.ts')
-rw-r--r-- | server/helpers/core-utils.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts index f8dd45533..2ec7e6515 100644 --- a/server/helpers/core-utils.ts +++ b/server/helpers/core-utils.ts | |||
@@ -25,8 +25,15 @@ function isTestInstance () { | |||
25 | } | 25 | } |
26 | 26 | ||
27 | function root () { | 27 | function root () { |
28 | // We are in /dist/helpers/utils.js | 28 | // We are in /helpers/utils.js |
29 | return join(__dirname, '..', '..', '..') | 29 | const paths = [ __dirname, '..', '..' ] |
30 | |||
31 | // We are under /dist directory | ||
32 | if (process.mainModule.filename.endsWith('.ts') === false) { | ||
33 | paths.push('..') | ||
34 | } | ||
35 | |||
36 | return join.apply(null, paths) | ||
30 | } | 37 | } |
31 | 38 | ||
32 | function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> { | 39 | function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> { |