diff --git a/commands/customObject/create.ts b/commands/customObject/create.ts index 2e483dfde..40e3ea989 100644 --- a/commands/customObject/create.ts +++ b/commands/customObject/create.ts @@ -20,9 +20,14 @@ exports.describe = i18n(`${i18nKey}.describe`); exports.handler = async options => { const { path, name: providedName, derivedAccountId } = options; let definitionPath = path; + let name = providedName; trackCommandUsage('custom-object-batch-create', null, derivedAccountId); + if (!name) { + name = await inputPrompt(i18n(`${i18nKey}.inputName`)); + } + if (!definitionPath) { definitionPath = await inputPrompt(i18n(`${i18nKey}.inputPath`)); } @@ -34,9 +39,6 @@ exports.handler = async options => { process.exit(EXIT_CODES.ERROR); } - const name = - providedName || (await inputPrompt(i18n(`${i18nKey}.inputSchema`))); - try { await batchCreateObjects(derivedAccountId, name, objectJson); logger.success(i18n(`${i18nKey}.success.objectsCreated`)); diff --git a/lang/en.lyaml b/lang/en.lyaml index ec2cb9694..29b34f624 100644 --- a/lang/en.lyaml +++ b/lang/en.lyaml @@ -214,8 +214,8 @@ en: describe: "Schema name to add the object instance to" success: objectsCreated: "Objects created" - inputSchema: "What would you like to name the schema?" - inputPath: "[--path] Where is the JSON file containing the object definitions?" + inputName: "Enter the name of the schema for the custom object(s) you'd like to create:" + inputPath: "[--path] Enter the path to the JSON file containing the object definitions:" schema: describe: "Commands for managing custom object schemas." subcommands: