diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-11 15:19:43 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-11 15:19:43 +0200 |
commit | 1840c2f7c91f5f89602a3683d85b0a9df1454855 (patch) | |
tree | 7efc223222e2d318abfaef0839a79e23be727cea /server/helpers/core-utils.ts | |
parent | 8635a2c70cc24a4c52558162ac058de95750271f (diff) | |
download | PeerTube-1840c2f7c91f5f89602a3683d85b0a9df1454855.tar.gz PeerTube-1840c2f7c91f5f89602a3683d85b0a9df1454855.tar.zst PeerTube-1840c2f7c91f5f89602a3683d85b0a9df1454855.zip |
Update webpack stack
Diffstat (limited to 'server/helpers/core-utils.ts')
-rw-r--r-- | server/helpers/core-utils.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts new file mode 100644 index 000000000..32b89b6dd --- /dev/null +++ b/server/helpers/core-utils.ts | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | Different from 'utils' because we don't not import other PeerTube modules. | ||
3 | Useful to avoid circular dependencies. | ||
4 | */ | ||
5 | |||
6 | import { join } from 'path' | ||
7 | |||
8 | function isTestInstance () { | ||
9 | return process.env.NODE_ENV === 'test' | ||
10 | } | ||
11 | |||
12 | function root () { | ||
13 | // We are in /dist/helpers/utils.js | ||
14 | return join(__dirname, '..', '..', '..') | ||
15 | } | ||
16 | |||
17 | // --------------------------------------------------------------------------- | ||
18 | |||
19 | export { | ||
20 | isTestInstance, | ||
21 | root | ||
22 | } | ||