Skip to content
Snippets Groups Projects
Commit 5fc9d0ab authored by Marcus Schiesser's avatar Marcus Schiesser
Browse files

fix: unify OpenAI key naming

parent 00be421d
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ export async function createApp({ ...@@ -29,7 +29,7 @@ export async function createApp({
packageManager, packageManager,
eslint, eslint,
frontend, frontend,
openAiKey: openAIKey, openAiKey,
model, model,
communityProjectPath, communityProjectPath,
}: InstallAppArgs): Promise<void> { }: InstallAppArgs): Promise<void> {
...@@ -68,7 +68,7 @@ export async function createApp({ ...@@ -68,7 +68,7 @@ export async function createApp({
packageManager, packageManager,
isOnline, isOnline,
eslint, eslint,
openAIKey, openAiKey,
model, model,
communityProjectPath, communityProjectPath,
}; };
......
...@@ -16,12 +16,12 @@ import { ...@@ -16,12 +16,12 @@ import {
TemplateFramework, TemplateFramework,
} from "./types"; } from "./types";
const createEnvLocalFile = async (root: string, openAIKey?: string) => { const createEnvLocalFile = async (root: string, openAiKey?: string) => {
if (openAIKey) { if (openAiKey) {
const envFileName = ".env"; const envFileName = ".env";
await fs.writeFile( await fs.writeFile(
path.join(root, envFileName), path.join(root, envFileName),
`OPENAI_API_KEY=${openAIKey}\n`, `OPENAI_API_KEY=${openAiKey}\n`,
); );
console.log(`Created '${envFileName}' file containing OPENAI_API_KEY`); console.log(`Created '${envFileName}' file containing OPENAI_API_KEY`);
} }
...@@ -32,7 +32,7 @@ const copyTestData = async ( ...@@ -32,7 +32,7 @@ const copyTestData = async (
framework: TemplateFramework, framework: TemplateFramework,
packageManager?: PackageManager, packageManager?: PackageManager,
engine?: TemplateEngine, engine?: TemplateEngine,
openAIKey?: string, openAiKey?: string,
) => { ) => {
if (framework === "nextjs") { if (framework === "nextjs") {
// XXX: This is a hack to make the build for nextjs work with pdf-parse // XXX: This is a hack to make the build for nextjs work with pdf-parse
...@@ -53,7 +53,7 @@ const copyTestData = async ( ...@@ -53,7 +53,7 @@ const copyTestData = async (
} }
if (packageManager && engine === "context") { if (packageManager && engine === "context") {
if (openAIKey || process.env["OPENAI_API_KEY"]) { if (openAiKey || process.env["OPENAI_API_KEY"]) {
console.log( console.log(
`\nRunning ${cyan( `\nRunning ${cyan(
`${packageManager} run generate`, `${packageManager} run generate`,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment