@thebros/create-benjamin 1.0.7 ā 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +4 -12
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
|
|
2
3
|
import "dotenv/config";
|
|
3
4
|
import fs from "fs-extra";
|
|
4
5
|
import path from "path";
|
|
@@ -7,25 +8,16 @@ import inquirer from "inquirer";
|
|
|
7
8
|
import ora from "ora";
|
|
8
9
|
import OpenAI from "openai";
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
11
|
const apiKey = process.env.OPENAI_API_KEY;
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (apiKey) {
|
|
18
|
-
openai = new OpenAI({ apiKey });
|
|
19
|
-
} else {
|
|
20
|
-
console.error(chalk.red("Error: OPENAI_API_KEY is not set in .env file"));
|
|
13
|
+
if (!apiKey) {
|
|
14
|
+
console.error(chalk.red("ā Missing OPENAI_API_KEY"));
|
|
21
15
|
process.exit(1);
|
|
22
16
|
}
|
|
23
17
|
|
|
24
|
-
|
|
25
18
|
const openai = new OpenAI({
|
|
26
|
-
apiKey
|
|
19
|
+
apiKey,
|
|
27
20
|
});
|
|
28
|
-
|
|
29
21
|
async function main() {
|
|
30
22
|
console.log(chalk.cyan("\nš¤ Create Benjamin AI Project Generator\n"));
|
|
31
23
|
|