Skip to content

🎥 Make videos programmatically with React

Merge branch 'main' into detect-remotion-root-dir

Jonny Burgera85cd812f6da
diff --cc packages/cli/src/get-env.ts
index f67f4277f6,b24ef7962f..3e02d565ff
--- a/packages/cli/src/get-env.ts
+++ b/packages/cli/src/get-env.ts
@@@ -1,8 -1,7 +1,8 @@@
import dotenv from 'dotenv';
import fs from 'fs';
import path from 'path';
- import {Internals} from 'remotion';
+ import {ConfigInternals} from './config';
+import {findRemotionRoot} from './find-closest-package-json';
import {Log} from './log';
import {parsedCli} from './parse-command-line';
@@@ -52,12 -51,9 +52,11 @@@ export const getEnvironmentVariables =
return getEnvForEnvFile(processEnv, envFile);
}
- const configFileSetting = Internals.getDotEnvLocation();
-
+ const remotionRoot = findRemotionRoot();
+
+ const configFileSetting = ConfigInternals.getDotEnvLocation();
if (configFileSetting) {
- const envFile = path.resolve(process.cwd(), configFileSetting);
+ const envFile = path.resolve(remotionRoot, configFileSetting);
if (!fs.existsSync(envFile)) {
Log.error(
'You specifed a custom .env file using `Config.Rendering.setDotEnvLocation()` in the config file but it could not be found'