neex 0.7.6 → 0.7.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/README.md +1 -1
- package/dist/src/commands/init-commands.js +16 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,18 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.runInit = void 0;
|
|
4
4
|
// src/commands/init-commands.ts
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
|
+
const os_1 = require("os");
|
|
6
7
|
function runInit(args) {
|
|
7
|
-
//
|
|
8
|
-
const
|
|
8
|
+
// Handle cross-platform npx command
|
|
9
|
+
const isWindows = (0, os_1.platform)() === 'win32';
|
|
10
|
+
const command = isWindows ? 'npx.cmd' : 'npx';
|
|
11
|
+
console.log('Initializing new project...');
|
|
12
|
+
const child = (0, child_process_1.spawn)(command, ['create-neex', ...args], {
|
|
9
13
|
stdio: 'inherit',
|
|
10
|
-
shell:
|
|
14
|
+
shell: isWindows,
|
|
15
|
+
env: process.env
|
|
11
16
|
});
|
|
12
17
|
child.on('close', (code) => {
|
|
13
|
-
|
|
18
|
+
if (code === 0) {
|
|
19
|
+
console.log('Project initialized successfully!');
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
console.error(`Process exited with code ${code}`);
|
|
23
|
+
}
|
|
14
24
|
process.exit(code !== null && code !== void 0 ? code : 1);
|
|
15
25
|
});
|
|
16
26
|
child.on('error', (err) => {
|
|
17
|
-
console.error('Failed to start npx create-neex:', err);
|
|
27
|
+
console.error('Failed to start npx create-neex:', err.message);
|
|
28
|
+
console.error('Make sure npm/npx is installed and accessible');
|
|
18
29
|
process.exit(1);
|
|
19
30
|
});
|
|
20
31
|
}
|