webide-cli 0.0.1-alpha.0
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 +1 -0
- package/init.js +24 -0
- package/package.json +23 -0
- package/preinstall.js +0 -0
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/init.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const os = require('os');
|
|
2
|
+
const fs = require('fs/promises');
|
|
3
|
+
|
|
4
|
+
const platform = os.platform();
|
|
5
|
+
const arch = os.arch();
|
|
6
|
+
const workdir = process.cwd();
|
|
7
|
+
const bindir = "/usr/bin/";
|
|
8
|
+
|
|
9
|
+
console.log(workdir);
|
|
10
|
+
if (platform === "linux" && arch === "arm64") {
|
|
11
|
+
fs.writeFile(bindir + "webide", `#!/bin/bash
|
|
12
|
+
node ${workdir}/index.js "$@"
|
|
13
|
+
`).then(() => {
|
|
14
|
+
return fs.chmod(bindir + "webide", 0o755);
|
|
15
|
+
}).then(() => {
|
|
16
|
+
console.log("Installation successful! You can now use 'webide' command.");
|
|
17
|
+
}).catch((err) => {
|
|
18
|
+
console.error("Installation failed:", err);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
});
|
|
21
|
+
} else {
|
|
22
|
+
console.error("This CLI is only for NEW WebIDE's Linux Terminal.");
|
|
23
|
+
process.exit(114514);
|
|
24
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "webide-cli",
|
|
3
|
+
"version": "0.0.1-alpha.0",
|
|
4
|
+
"description": "A CLI for NEW WebIDE",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"WebIDE",
|
|
7
|
+
"IFTC",
|
|
8
|
+
"VV"
|
|
9
|
+
],
|
|
10
|
+
"bin": {
|
|
11
|
+
"webide": "index.js"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "IFTC",
|
|
15
|
+
"type": "commonjs",
|
|
16
|
+
"main": "index.js",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
19
|
+
"debug": "node index",
|
|
20
|
+
"postinstall": "node init",
|
|
21
|
+
"preinstall": "node preinstall"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/preinstall.js
ADDED
|
File without changes
|