configCore: default to enterprise edition if TEST_ENABLE_ACTIVATION is truthy

This will ensure that the grist-ee image will have a consistent config
setting when created from the default value.
pull/1141/head
Jordi Gutiérrez Hermoso 2 months ago committed by jordigh
parent f0aacc4d96
commit d57c3f068d

@ -4,7 +4,8 @@ import {
fileConfigAccessorFactory,
IWritableConfigValue
} from "./config";
import { convertToCoreFileContents, IGristCoreConfigFileLatest } from "./configCoreFileFormats";
import {convertToCoreFileContents, IGristCoreConfigFileLatest} from "./configCoreFileFormats";
import {isAffirmative} from 'app/common/gutil';
export type Edition = "core" | "enterprise";
@ -23,6 +24,9 @@ export function loadGristCoreConfigFile(configPath?: string): IGristCoreConfig {
export function loadGristCoreConfig(fileConfig?: FileConfig<IGristCoreConfigFileLatest>): IGristCoreConfig {
const fileConfigValue = fileConfigAccessorFactory(fileConfig);
return {
edition: createConfigValue<Edition>("core", fileConfigValue("edition"))
edition: createConfigValue<Edition>(
isAffirmative(process.env.TEST_ENABLE_ACTIVATION) ? "enterprise" : "core",
fileConfigValue("edition")
)
};
}

Loading…
Cancel
Save