Skip to content

🎥 Make videos programmatically with React

formatting and make update blue

Jonny Burger767c6dba98e1
diff --git a/packages/bundler/src/index-html.ts b/packages/bundler/src/index-html.ts
index 0552458567..438bf00d8c 100644
--- a/packages/bundler/src/index-html.ts
+++ b/packages/bundler/src/index-html.ts
@@ -4,7 +4,7 @@ export const indexHtml = ({
baseDir,
editorName,
inputProps,
- envVariables,
+ envVariables,
staticHash,
remotionRoot,
previewServerCommand,
@@ -13,7 +13,7 @@ export const indexHtml = ({
baseDir: string;
editorName: string | null;
inputProps: object | null;
- envVariables?: Record<string, string>
+ envVariables?: Record<string, string>;
remotionRoot: string;
previewServerCommand: string | null;
}) =>
@@ -52,12 +52,12 @@ export const indexHtml = ({
: ''
}
${
- envVariables
- ? `<script> window.process = {
+ envVariables
+ ? `<script> window.process = {
env: ${JSON.stringify(envVariables)}
};</script>
`
- : ''
+ : ''
}
<div id="container"></div>
diff --git a/packages/cli/src/get-env.ts b/packages/cli/src/get-env.ts
index 7f5a54a6f6..b5b6365b59 100644
--- a/packages/cli/src/get-env.ts
+++ b/packages/cli/src/get-env.ts
@@ -1,6 +1,7 @@
import dotenv from 'dotenv';
import fs from 'fs';
import path from 'path';
+import {chalk} from './chalk';
import {ConfigInternals} from './config';
import {findRemotionRoot} from './find-closest-package-json';
import {Log} from './log';
@@ -29,16 +30,14 @@ const getEnvForEnvFile = async (
const envFileData = await fs.promises.readFile(envFile);
fs.watchFile(envFile, {interval: 100}, async () => {
try {
- const file = await fs.promises.readFile(envFile, 'utf-8')
+ const file = await fs.promises.readFile(envFile, 'utf-8');
onUpdate({
...processEnv,
...dotenv.parse(file),
});
- Log.info(`Updated env file ${envFile}.`);
+ Log.info(chalk.blueBright(`Updated env file ${envFile}`));
} catch (err) {
- Log.error(
- `${envFile} update fails with error ${err}`
- );
+ Log.error(`${envFile} update fails with error ${err}`);
}
});
return {
@@ -52,7 +51,9 @@ const getEnvForEnvFile = async (
}
};
-export const getEnvironmentVariables = (onUpdate: (newProps: Record<string, string>) => void): Promise<Record<string, string>> => {
+export const getEnvironmentVariables = (
+ onUpdate: (newProps: Record<string, string>) => void
+): Promise<Record<string, string>> => {
const processEnv = getProcessEnv();
if (parsedCli['env-file']) {
diff --git a/packages/cli/src/preview-server/routes.ts b/packages/cli/src/preview-server/routes.ts
index 7e3da10d5b..e981dc101b 100644
--- a/packages/cli/src/preview-server/routes.ts
+++ b/packages/cli/src/preview-server/routes.ts
@@ -41,7 +41,7 @@ const handleFallback = async ({
hash,
response,
getCurrentInputProps,
- getEnvVariables,
+ getEnvVariables,
}: {
remotionRoot: string;
hash: string;
@@ -187,7 +187,7 @@ export const handleRoutes = ({
response,
liveEventsServer,
getCurrentInputProps,
- getEnvVariables,
+ getEnvVariables,
remotionRoot,
userPassedPublicDir,
}: {