From 4555e07586c77267326f16a1e9821ee174535879 Mon Sep 17 00:00:00 2001 From: Atila Fassina Date: Fri, 4 Oct 2024 23:13:50 +0200 Subject: [PATCH] feat: clear identifier with a default as fallback (#36) --- src/run.ts | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/run.ts b/src/run.ts index 7b45b85..d5827fe 100644 --- a/src/run.ts +++ b/src/run.ts @@ -58,19 +58,16 @@ export async function run() { log.info(`Creating your app at ${destinationDir}`); - const identifier = (await text({ - initialValue: `com.you.${name.replaceAll("-", "")}`, - message: "What is the identifier of your app?", - placeholder: "com.yourcompany.yourapp", - validate(value: string | symbol) { - if (typeof value === "symbol") { - return `Value must be a string!`; - } - if (value.length === 0) { - return `Value is required!`; - } - }, - })) as string; + const identifier = + ((await text({ + message: "What is the identifier of your app?", + placeholder: `com.you.${name.replaceAll("-", "")}`, + validate(value: string | symbol) { + if (typeof value === "symbol") { + return `Value must be a string!`; + } + }, + })) as string) || `com.you.${name.replaceAll("-", "")}`; const signingIdentity = (await text({ initialValue: "-",