webide-cli 0.0.1-alpha.1 → 0.0.1-alpha.2

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 CHANGED
@@ -1,3 +1,17 @@
1
1
  #!/usr/bin/env node
2
+ const { program } = require('commander');
3
+ const { version } = require('./package.json');
2
4
 
3
- console.log("Welcome to WebIDE CLI!");
5
+ program
6
+ .version(version)
7
+ .command('init', 'Initialize a new project')
8
+ .command('build', 'Build the project')
9
+ .command('run', 'Run the project')
10
+ .command('deploy', 'Deploy the project')
11
+ .command('help', 'Show help')
12
+ .parse(process.argv);
13
+
14
+ const args = program.opts();
15
+
16
+ console.log("Welcome to WebIDE CLI!");
17
+ console.log(process.cwd());
package/init.js CHANGED
@@ -6,7 +6,7 @@ const arch = os.arch();
6
6
  const workdir = process.cwd();
7
7
  const bindir = "/usr/bin/";
8
8
 
9
- console.log(workdir);
9
+ // console.log(workdir);
10
10
  if (platform === "linux" && arch === "arm64") {
11
11
  fs.writeFile(bindir + "webide", `#!/bin/bash
12
12
  node ${workdir}/index.js "$@"
@@ -16,7 +16,7 @@ node ${workdir}/index.js "$@"
16
16
  console.log("Installation successful! You can now use 'webide' command.");
17
17
  }).catch((err) => {
18
18
  console.error("Installation failed:", err);
19
- process.exit(1);
19
+ process.exit(114514);
20
20
  });
21
21
  } else {
22
22
  console.error("This CLI is only for NEW WebIDE's Linux Terminal.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webide-cli",
3
- "version": "0.0.1-alpha.1",
3
+ "version": "0.0.1-alpha.2",
4
4
  "description": "A CLI for NEW WebIDE",
5
5
  "keywords": [
6
6
  "WebIDE",
@@ -17,7 +17,9 @@
17
17
  "scripts": {
18
18
  "test": "echo \"Error: no test specified\" && exit 1",
19
19
  "debug": "node index",
20
- "postinstall": "node init",
21
- "preinstall": "node preinstall"
20
+ "postinstall": "node init"
21
+ },
22
+ "dependencies": {
23
+ "commander": "^14.0.2"
22
24
  }
23
25
  }
package/preinstall.js DELETED
File without changes