From 5fc9d0abb3286c22b9153b06c9a7a76ed8c43fcd Mon Sep 17 00:00:00 2001
From: Marcus Schiesser <mail@marcusschiesser.de>
Date: Wed, 6 Dec 2023 14:22:43 +0700
Subject: [PATCH] fix: unify OpenAI key naming

---
 create-app.ts      |  4 ++--
 templates/index.ts | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/create-app.ts b/create-app.ts
index 26adac81..cdaa6dbc 100644
--- a/create-app.ts
+++ b/create-app.ts
@@ -29,7 +29,7 @@ export async function createApp({
   packageManager,
   eslint,
   frontend,
-  openAiKey: openAIKey,
+  openAiKey,
   model,
   communityProjectPath,
 }: InstallAppArgs): Promise<void> {
@@ -68,7 +68,7 @@ export async function createApp({
     packageManager,
     isOnline,
     eslint,
-    openAIKey,
+    openAiKey,
     model,
     communityProjectPath,
   };
diff --git a/templates/index.ts b/templates/index.ts
index 76b9f880..79746b62 100644
--- a/templates/index.ts
+++ b/templates/index.ts
@@ -16,12 +16,12 @@ import {
   TemplateFramework,
 } from "./types";
 
-const createEnvLocalFile = async (root: string, openAIKey?: string) => {
-  if (openAIKey) {
+const createEnvLocalFile = async (root: string, openAiKey?: string) => {
+  if (openAiKey) {
     const envFileName = ".env";
     await fs.writeFile(
       path.join(root, envFileName),
-      `OPENAI_API_KEY=${openAIKey}\n`,
+      `OPENAI_API_KEY=${openAiKey}\n`,
     );
     console.log(`Created '${envFileName}' file containing OPENAI_API_KEY`);
   }
@@ -32,7 +32,7 @@ const copyTestData = async (
   framework: TemplateFramework,
   packageManager?: PackageManager,
   engine?: TemplateEngine,
-  openAIKey?: string,
+  openAiKey?: string,
 ) => {
   if (framework === "nextjs") {
     // XXX: This is a hack to make the build for nextjs work with pdf-parse
@@ -53,7 +53,7 @@ const copyTestData = async (
   }
 
   if (packageManager && engine === "context") {
-    if (openAIKey || process.env["OPENAI_API_KEY"]) {
+    if (openAiKey || process.env["OPENAI_API_KEY"]) {
       console.log(
         `\nRunning ${cyan(
           `${packageManager} run generate`,
-- 
GitLab