aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/core-utils.ts
blob: 32b89b6dd583ff8175fc8d4581553341757cbbbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
  Different from 'utils' because we don't not import other PeerTube modules.
  Useful to avoid circular dependencies.
*/

import { join } from 'path'

function isTestInstance () {
  return process.env.NODE_ENV === 'test'
}

function root () {
  // We are in /dist/helpers/utils.js
  return join(__dirname, '..', '..', '..')
}

// ---------------------------------------------------------------------------

export {
  isTestInstance,
  root
}