Skip to content

🎥 Make videos programmatically with React

fix another lambda bug

Jonny Burger91579e8b7e57
diff --git a/packages/example/package.json b/packages/example/package.json
index 36504c70e5..2c20da0e1b 100644
--- a/packages/example/package.json
+++ b/packages/example/package.json
@@ -29,6 +29,7 @@
"@remotion/eslint-config": "^2.3.3",
"@remotion/eslint-plugin": "^2.3.3",
"@remotion/gif": "^2.3.3",
+ "@remotion/lambda": "^2.3.3",
"@remotion/media-utils": "^2.3.3",
"@remotion/renderer": "^2.3.3",
"@remotion/three": "^2.3.3",
diff --git a/packages/lambda/package.json b/packages/lambda/package.json
index 79ba028f39..a1ef7dbaab 100644
--- a/packages/lambda/package.json
+++ b/packages/lambda/package.json
@@ -1,6 +1,6 @@
{
"name": "@remotion/lambda",
- "version": "2.3.2",
+ "version": "2.3.3",
"description": "Utility functions for audio and video",
"main": "dist/index.js",
"sideEffects": false,
diff --git a/packages/lambda/src/cli/commands/policies/role.ts b/packages/lambda/src/cli/commands/policies/role.ts
index 08d30ee707..ecb1a29071 100644
--- a/packages/lambda/src/cli/commands/policies/role.ts
+++ b/packages/lambda/src/cli/commands/policies/role.ts
@@ -3,5 +3,5 @@ import {Log} from '../../log';
export const ROLE_SUBCOMMAND = 'role';
export const roleSubcommand = () => {
- Log.info(JSON.stringify(getRolePolicy(), null, 2));
+ Log.info(getRolePolicy());
};
diff --git a/packages/lambda/src/cli/commands/policies/user.ts b/packages/lambda/src/cli/commands/policies/user.ts
index fca65a6566..0e7480b1fc 100644
--- a/packages/lambda/src/cli/commands/policies/user.ts
+++ b/packages/lambda/src/cli/commands/policies/user.ts
@@ -4,5 +4,5 @@ import {Log} from '../../log';
export const USER_SUBCOMMAND = 'user';
export const userSubcommand = () => {
- Log.info(JSON.stringify(getUserPolicy(), null, 2));
+ Log.info(getUserPolicy());
};
diff --git a/packages/lambda/src/cli/index.ts b/packages/lambda/src/cli/index.ts
index 331dccfe6e..925e0ff519 100644
--- a/packages/lambda/src/cli/index.ts
+++ b/packages/lambda/src/cli/index.ts
@@ -4,19 +4,38 @@ import {parsedLambdaCli} from './args';
import {cleanupCommand, CLEANUP_COMMAND} from './cleanup';
import {functionsCommand, FUNCTIONS_COMMAND} from './commands/functions';
import {policiesCommand, POLICIES_COMMAND} from './commands/policies/policies';
+import {ROLE_SUBCOMMAND} from './commands/policies/role';
+import {USER_SUBCOMMAND} from './commands/policies/user';
import {renderCommand, RENDER_COMMAND} from './commands/render';
import {sitesCommand, SITES_COMMAND} from './commands/sites';
import {stillCommand, STILL_COMMAND} from './commands/still';
import {printHelp} from './help';
import {Log} from './log';
+const requiresCredentials = (args: string[]) => {
+ if (args[0] === POLICIES_COMMAND) {
+ if (args[1] === USER_SUBCOMMAND) {
+ return false;
+ }
+
+ if (args[1] === ROLE_SUBCOMMAND) {
+ return false;
+ }
+ }
+
+ return true;
+};
+
const matchCommand = async (args: string[]) => {
- checkCredentials();
if (parsedLambdaCli.help || args.length === 0) {
printHelp();
process.exit(0);
}
+ if (requiresCredentials(args)) {
+ checkCredentials();
+ }
+
if (args[0] === RENDER_COMMAND) {
return renderCommand(args.slice(1));
}