mongossee 1.0.5 → 1.0.7
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/index.js +12 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
const fs = require('fs');
|
|
3
4
|
const path = require('path');
|
|
4
|
-
|
|
5
|
-
require('dotenv').config({ path: path.join(__dirname, '.env') });
|
|
6
|
-
|
|
7
|
-
const fs = require('fs'); // Node.js File System
|
|
8
|
-
//const path = require('path'); // Node.js Path module
|
|
5
|
+
const os = require('os'); // System user info ke liye
|
|
9
6
|
const yargs = require('yargs/yargs');
|
|
10
7
|
const { hideBin } = require('yargs/helpers');
|
|
11
8
|
|
|
12
|
-
//
|
|
13
|
-
//
|
|
9
|
+
// 👇 CHANGE 1: Ab hum key ko User ke Home folder mein dhoondhenge
|
|
10
|
+
// Windows par path hoga: C:\Users\rajga\.javix-env
|
|
11
|
+
const envPath = path.join(os.homedir(), '.javix-env');
|
|
12
|
+
require('dotenv').config({ path: envPath });
|
|
14
13
|
|
|
15
|
-
//
|
|
14
|
+
// 👇 CHANGE 2: Key check karein
|
|
16
15
|
const API_KEY = process.env.GEMINI_API_KEY;
|
|
17
16
|
|
|
18
|
-
// Check karein ki key mili ya nahi
|
|
19
17
|
if (!API_KEY) {
|
|
20
|
-
console.error("ERROR
|
|
18
|
+
console.error("❌ ERROR: API Key nahi mili!");
|
|
19
|
+
console.error(`Please create a file at: ${envPath}`);
|
|
20
|
+
console.error("And add this line inside it: GEMINI_API_KEY=your_key_here");
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
// ... baaki ka code waisa hi rahega (async function generateProject...)
|
|
25
|
+
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
* Generates a full project structure based on a prompt.
|