chore: Centralize environment detection
This commit is contained in:
@@ -3,8 +3,6 @@ import ReactDOMServer from "react-dom/server";
|
||||
import env from "@server/env";
|
||||
import readManifestFile, { ManifestStructure } from "./readManifestFile";
|
||||
|
||||
const isProduction = env.ENVIRONMENT === "production";
|
||||
|
||||
const prefetchTags = [];
|
||||
|
||||
if (env.AWS_S3_ACCELERATE_URL) {
|
||||
@@ -30,7 +28,7 @@ if (env.CDN_URL) {
|
||||
);
|
||||
}
|
||||
|
||||
if (isProduction) {
|
||||
if (env.isProduction) {
|
||||
const manifest = readManifestFile();
|
||||
|
||||
const returnFileAndImportsFromManifest = (
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user