mattermost-desktop/scripts/check_build_config.js
Devin Binnie 1b3d0eac8f
Migrate app to TypeScript (#1637)
* Initial setup and migrated src/common

* WIP

* WIP

* WIP

* Main module basically finished

* Renderer process migrated

* Added CI step and some fixes

* Fixed remainder of issues and added proper ESLint config

* Fixed a couple issues

* Progress!

* Some more fixes

* Fixed a test

* Fix build step

* PR feedback
2021-06-28 09:51:23 -04:00

20 lines
725 B
JavaScript

// Copyright (c) 2015-2016 Yuya Ochiai
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
const buildConfig = require('../dist/buildConfig');
function validateBuildConfig(config) {
if (config.enableServerManagement === false && config.defaultTeams && config.defaultTeams.length === 0) {
return {
result: false,
message: `Specify at least one server for "defaultTeams" in buildConfig.js when "enableServerManagement is set to false.\n${JSON.stringify(config, null, 2)}`,
};
}
return {result: true};
}
const ret = validateBuildConfig(buildConfig);
if (ret.result === false) {
throw new Error(ret.message);
}