mongossee 1.0.17 ā 1.0.19
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 +6 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
5
|
const yargs = require('yargs/yargs');
|
|
6
6
|
const { hideBin } = require('yargs/helpers');
|
|
7
7
|
|
|
@@ -33,7 +33,7 @@ async function generateProject(prompt, directoryName) {
|
|
|
33
33
|
const data = await response.json();
|
|
34
34
|
|
|
35
35
|
// 1. Check Server Success
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
if (!response.ok || !data.success) {
|
|
38
38
|
const errorMessage = data.error || 'Unknown Server Error';
|
|
39
39
|
console.error(`\nā Server Error: ${errorMessage}`);
|
|
@@ -44,7 +44,7 @@ async function generateProject(prompt, directoryName) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// 2. Get Files Directly (No Parsing Needed)
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
const files = data.files;
|
|
49
49
|
|
|
50
50
|
if (!Array.isArray(files)) {
|
|
@@ -72,10 +72,10 @@ async function generateProject(prompt, directoryName) {
|
|
|
72
72
|
//console.log(`Created file: ${filePath}`);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
// console.log(`\n
|
|
75
|
+
// console.log(`\n Project "${directoryName}" created successfully!`);
|
|
76
76
|
|
|
77
77
|
} catch (error) {
|
|
78
|
-
console.error('
|
|
78
|
+
console.error(' An error occurred:', error.message);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|