From 5d920c998a06eb167f8d8c57094c72384d3717bf Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Tue, 7 Jan 2025 17:05:20 -0500 Subject: [PATCH 1/2] Improve custom object create prompt --- commands/customObject/create.ts | 8 +++++--- lang/en.lyaml | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) 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: From a12c6a75a35be145cf1d84aa57cbaa479bae3bc0 Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Tue, 7 Jan 2025 17:16:42 -0500 Subject: [PATCH 2/2] add name flag indicator to hs custom object create prompt --- lang/en.lyaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/en.lyaml b/lang/en.lyaml index 29b34f624..3ce2a43d3 100644 --- a/lang/en.lyaml +++ b/lang/en.lyaml @@ -214,7 +214,7 @@ en: describe: "Schema name to add the object instance to" success: objectsCreated: "Objects created" - inputName: "Enter the name of the schema for the custom object(s) you'd like to create:" + inputName: "[--name] 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."