acadex-cli 1.0.0 → 1.0.1
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/acadex.js +38 -0
- package/package.json +3 -3
package/bin/acadex.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
|
|
7
|
+
const platform = os.platform();
|
|
8
|
+
const scriptDir = __dirname;
|
|
9
|
+
|
|
10
|
+
let scriptPath;
|
|
11
|
+
let shell;
|
|
12
|
+
let shellArgs;
|
|
13
|
+
|
|
14
|
+
if (platform === 'win32') {
|
|
15
|
+
// Windows - use PowerShell script
|
|
16
|
+
scriptPath = path.join(scriptDir, 'acadex.ps1');
|
|
17
|
+
shell = 'powershell.exe';
|
|
18
|
+
shellArgs = ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', scriptPath, ...process.argv.slice(2)];
|
|
19
|
+
} else {
|
|
20
|
+
// Unix-like systems (Linux, macOS) - use bash script
|
|
21
|
+
scriptPath = path.join(scriptDir, 'acadex');
|
|
22
|
+
shell = scriptPath;
|
|
23
|
+
shellArgs = process.argv.slice(2);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const child = spawn(shell, shellArgs, {
|
|
27
|
+
stdio: 'inherit',
|
|
28
|
+
shell: platform === 'win32' ? false : false
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
child.on('exit', (code) => {
|
|
32
|
+
process.exit(code || 0);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
child.on('error', (err) => {
|
|
36
|
+
console.error('Failed to start subprocess:', err);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
});
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acadex-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A global CLI tool for managing Acadex projects with easy setup and automation",
|
|
5
|
-
"main": "acadex",
|
|
5
|
+
"main": "bin/acadex.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"acadex": "./acadex"
|
|
7
|
+
"acadex": "./bin/acadex.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|