2019-03-28 13:02:56 -04:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const ROOT_PATH = path.resolve(__dirname, '../..');
|
|
|
|
|
2019-10-16 14:08:01 -04:00
|
|
|
// The `FOSS_ONLY` is always `string` or `nil`
|
2019-10-15 05:06:09 -04:00
|
|
|
// Thus the nil or empty string will result
|
2019-10-16 14:08:01 -04:00
|
|
|
// in using default value: false
|
2019-10-15 05:06:09 -04:00
|
|
|
//
|
|
|
|
// The behavior needs to be synchronised with
|
|
|
|
// lib/gitlab.rb: Gitlab.ee?
|
2019-10-16 14:08:01 -04:00
|
|
|
const isFossOnly = JSON.parse(process.env.FOSS_ONLY || 'false');
|
2019-03-28 13:02:56 -04:00
|
|
|
module.exports =
|
2019-10-16 14:08:01 -04:00
|
|
|
fs.existsSync(path.join(ROOT_PATH, 'ee', 'app', 'models', 'license.rb')) && !isFossOnly;
|