diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-09-07 15:27:35 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-09-07 15:54:34 +0200 |
commit | fdbda9e3d6564ec908733c7019305f6a3c363a9f (patch) | |
tree | c596034156f167e7cfafe41c4a3fc6adda488a0d /server/helpers/core-utils.ts | |
parent | 04de542abd940f9d2ca213fba3c68580c6c9b78a (diff) | |
download | PeerTube-fdbda9e3d6564ec908733c7019305f6a3c363a9f.tar.gz PeerTube-fdbda9e3d6564ec908733c7019305f6a3c363a9f.tar.zst PeerTube-fdbda9e3d6564ec908733c7019305f6a3c363a9f.zip |
Add tests for npm run scripts
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> { |