Skip to content

Commit 4b3b94d

Browse files
authored
πŸ‘Œ IMPROVE: Learn docs (#22)
* Update index.mdx - add install dotenv * Update index.mdx - add description about dotenv * init script - add .evn file to .gitignore by default * refactor updateGitignore() to have 1 param gitignoreEntry: string * remove -S from npm install dotenv
1 parent a209977 commit 4b3b94d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

β€Žapps/baseai.dev/content/learn/learn/index.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ Create a directory in your local machine and navigate to it. Run the following c
4848
```bash
4949
mkdir my-ai-project
5050
npm init -y
51+
npm install dotenv
5152
```
5253

53-
This command will create a `package.json` file in your project directory with default values.
54+
This command will create a `package.json` file in your project directory with default values. It will also install `dotenv` package to read environment variables from `.env` file.
5455

5556
---
5657

β€Žpackages/baseai/src/init/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,8 @@ function displayOutro({ calledAsCommand }: { calledAsCommand: boolean }): void {
233233
}
234234
}
235235

236-
async function updateGitignore(): Promise<void> {
236+
async function updateGitignore(gitignoreEntry: string): Promise<void> {
237237
const gitignorePath = path.join(process.cwd(), '.gitignore');
238-
const gitignoreEntry = '# baseai\n**/.baseai/\n';
239238

240239
try {
241240
let gitignoreContent = '';
@@ -356,7 +355,8 @@ export async function init({
356355
await createBaseAIDirectories();
357356
await createConfigFile();
358357
await updatePackageJsonScript();
359-
await updateGitignore();
358+
await updateGitignore('# baseai\n**/.baseai/\n');
359+
await updateGitignore('# env file\n.env\n');
360360
await createEnvBaseAIExample();
361361

362362
displayOutro({ calledAsCommand });

0 commit comments

Comments
Β (0)