🎥 Make videos programmatically with React
still
Jonny Burgerdafbb0d7fb38
diff --git a/packages/cli/src/initialize-render-cli.ts b/packages/cli/src/initialize-render-cli.tsindex 3968211e50..c030cddc6b 100644--- a/packages/cli/src/initialize-render-cli.ts+++ b/packages/cli/src/initialize-render-cli.ts@@ -2,7 +2,7 @@ import {loadConfig} from './get-config-file-name';import {Log} from './log';import {parseCommandLine} from './parse-command-line';-export const initializeRenderCli = () => {+export const initializeRenderCli = (type: 'still' | 'sequence') => {parseCommandLine();const appliedName = loadConfig();if (appliedName) {diff --git a/packages/cli/src/parse-command-line.ts b/packages/cli/src/parse-command-line.tsindex b1de471a4c..c24e8235e8 100644--- a/packages/cli/src/parse-command-line.ts+++ b/packages/cli/src/parse-command-line.ts@@ -39,7 +39,7 @@ export const parsedCli = minimist<CommandLineOptions>(process.argv.slice(2), {boolean: ['force', 'overwrite', 'sequence', 'help'],});-export const parseCommandLine = () => {+export const parseCommandLine = (type: 'still' | 'sequence') => {if (parsedCli['pixel-format']) {Config.Output.setPixelFormat(parsedCli['pixel-format']);}@@ -75,10 +75,24 @@ export const parseCommandLine = () => {}if (parsedCli.frames) {+ if (type === 'still') {+ Log.error(+ '--frames flag was passed to the `still` command. This flag only works with the `render` command. Did you mean `--frame`? See reference: https://www.remotion.dev/docs/cli/'+ );+ process.exit(1);+ }+Internals.setFrameRangeFromCli(parsedCli.frames);}if (parsedCli.frame) {+ if (type === 'sequence') {+ Log.error(+ '--frame flag was passed to the `render` command. This flag only works with the `still` command. Did you mean `--frames`? See reference: https://www.remotion.dev/docs/cli/'+ );+ process.exit(1);+ }+Internals.setStillFrame(Number(parsedCli.frame));}diff --git a/packages/cli/src/render.tsx b/packages/cli/src/render.tsxindex 94342ebd7e..da4824f6df 100644--- a/packages/cli/src/render.tsx+++ b/packages/cli/src/render.tsx@@ -47,7 +47,7 @@ export const render = async () => {const file = parsedCli._[1];const fullPath = path.join(process.cwd(), file);- initializeRenderCli();+ initializeRenderCli('sequence');const {codec,diff --git a/packages/cli/src/still.ts b/packages/cli/src/still.tsindex cb5a833ad6..a5c8641155 100644--- a/packages/cli/src/still.ts+++ b/packages/cli/src/still.ts@@ -22,7 +22,7 @@ export const still = async () => {const file = parsedCli._[1];const fullPath = path.join(process.cwd(), file);- initializeRenderCli();+ initializeRenderCli('still');const userOutput = path.resolve(process.cwd(), getUserPassedOutputLocation());