From b76ae638462ab0f673e5915986070518dd3f9ad3 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 19 Aug 2021 09:08:42 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-2-stable-ee --- config/helpers/is_jh_env.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 config/helpers/is_jh_env.js (limited to 'config/helpers') diff --git a/config/helpers/is_jh_env.js b/config/helpers/is_jh_env.js new file mode 100644 index 00000000000..10251d3166e --- /dev/null +++ b/config/helpers/is_jh_env.js @@ -0,0 +1,16 @@ +const fs = require('fs'); +const path = require('path'); +const IS_EE = require('./is_ee_env'); + +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.jh? +// Since IS_EE already satisifies the conditions of not being a FOSS_ONLY. +// const isFossOnly = JSON.parse(process.env.FOSS_ONLY || 'false'); +const isEEOnly = JSON.parse(process.env.EE_ONLY || 'false'); +module.exports = IS_EE && !isEEOnly && fs.existsSync(path.join(ROOT_PATH, 'jh')); -- cgit v1.2.1