chore: Centralize environment detection

This commit is contained in:
Tom Moor
2023-11-09 09:13:50 -05:00
parent 096a65b0f9
commit a1b52e18dd
9 changed files with 37 additions and 31 deletions

View File

@@ -33,11 +33,10 @@ export async function checkDataMigrations() {
return;
}
const isProduction = env.ENVIRONMENT === "production";
const teams = await Team.count();
const providers = await AuthenticationProvider.count();
if (isProduction && teams && !providers) {
if (env.isProduction && teams && !providers) {
Logger.warn(`
This version of Outline cannot start until a data migration is complete.
Backup your database, run the database migrations and the following script: