summaryrefslogtreecommitdiff
path: root/config/helpers/is_ee_env.js
blob: 78f0bd655285168a9f99065b9f8ad781336aa587 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const fs = require('fs');
const path = require('path');

const ROOT_PATH = path.resolve(__dirname, '../..');

// The `FOSS_ONLY` is always `string` or `nil`
// Thus the nil or empty string will result
// in using default value: false
//
// The behavior needs to be synchronised with
// lib/gitlab.rb: Gitlab.ee?
const isFossOnly = JSON.parse(process.env.FOSS_ONLY || 'false');
module.exports =
  fs.existsSync(path.join(ROOT_PATH, 'ee', 'app', 'models', 'license.rb')) && !isFossOnly;