diff --git a/src/commands/export/create.mjs b/src/commands/export/create.mjs index aae0648e..01ffcb7d 100644 --- a/src/commands/export/create.mjs +++ b/src/commands/export/create.mjs @@ -153,6 +153,9 @@ function buildCreateS3ExportCommand(yargs) { "Either --destination or both --bucket and --path are required to create an export.", ); } + if (argv.idempotency?.trim() === "") { + throw new ValidationError("--idempotency cannot be an empty string."); + } return true; }) .example(sharedExamples); diff --git a/test/commands/export/create.mjs b/test/commands/export/create.mjs index ce576869..8b7e3fe7 100644 --- a/test/commands/export/create.mjs +++ b/test/commands/export/create.mjs @@ -200,6 +200,16 @@ idempotent_replayed: true expectedError: "Cannot specify --destination with --bucket or --path. Use either --destination or both --bucket and --path.", }, + { + description: "an empty string is given as the --idempotency input", + args: "--destination s3://test-bucket/test/key --idempotency ", + expectedError: "--idempotency cannot be an empty string.", + }, + { + description: "an blank string is given as the --idempotency input", + args: "--destination s3://test-bucket/test/key --idempotency ' '", + expectedError: "--idempotency cannot be an empty string.", + }, ]; invalidScenarios.forEach(({ description, args, expectedError }) => {