diff --git a/src/commands/new/common.ts b/src/commands/new/common.ts index 446eb87..6742c55 100644 --- a/src/commands/new/common.ts +++ b/src/commands/new/common.ts @@ -68,7 +68,7 @@ export const cloneKit = async (project: NewProject, kit: Kit) => { } catch (error) { spinner.fail(`Failed to clone ${config.products[kit].label}.`); logger.info( - `Need access to ${config.products[kit].label}? ${color.underline(config.products[kit].url)}`, + `Want to try ${config.products[kit].label}? Check out at ${color.underline(config.products[kit].url)}`, ); throw error; } @@ -141,6 +141,16 @@ export const setEnvironmentVariablesInPaths = async ( const spinner = ora(`Setting environment variables...`).start(); try { + const mappedKeys = new Set(Object.values(paths).flat()); + const unmappedKeys = Object.keys(variables).filter( + (key) => !mappedKeys.has(key), + ); + if (unmappedKeys.length > 0) { + logger.info( + `No environment file path configured for: ${unmappedKeys.join(", ")}`, + ); + } + for (const [key, value] of Object.entries(variables)) { const pathsForKey = _.keys( _.pickBy(paths, (values) => _.includes(values, key)), @@ -153,9 +163,8 @@ export const setEnvironmentVariablesInPaths = async ( spinner.succeed("Environment variables successfully set!"); } catch (error) { - logger.error(error); - logger.error("Failed to set environment variables!"); - process.exit(1); + spinner.fail("Failed to set environment variables!"); + throw error; } }; diff --git a/src/commands/new/core/config/definitions.ts b/src/commands/new/core/config/definitions.ts index 5f74c6b..8092504 100644 --- a/src/commands/new/core/config/definitions.ts +++ b/src/commands/new/core/config/definitions.ts @@ -330,6 +330,11 @@ export const envInPaths = { coreEnv.email.mailgun.apiUrl, coreEnv.email.nodemailer.user, coreEnv.email.nodemailer.password, + coreEnv.email.nodemailer.host, + coreEnv.email.nodemailer.port, + coreEnv.storage.s3.region, + coreEnv.storage.s3.bucket, + coreEnv.storage.s3.endpoint, coreEnv.storage.s3.accessKeyId, coreEnv.storage.s3.secretAccessKey, coreEnv.billing[App.WEB].stripe.secretKey,