@seyuna/cli 0.0.2-dev.8 → 0.0.2-dev.9
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/node-install.js +28 -23
- package/package.json +2 -2
- package/bin/seyuna +0 -26
- package/bin/seyuna-linux +0 -0
- package/bin/seyuna-macos +0 -0
- package/bin/seyuna-windows.exe +0 -0
- package/deno.json +0 -13
package/node-install.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mkdir, chmod } from "fs/promises";
|
|
1
|
+
import { mkdir, chmod, readFile } from "fs/promises";
|
|
2
2
|
import { createWriteStream } from "fs";
|
|
3
3
|
import { Readable } from "stream";
|
|
4
4
|
import path from "path";
|
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from "url";
|
|
|
6
6
|
import process from "process";
|
|
7
7
|
|
|
8
8
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const version = "0.0.2-dev.
|
|
9
|
+
const version = "0.0.2-dev.9";
|
|
10
10
|
|
|
11
11
|
async function downloadFile(url, dest) {
|
|
12
12
|
const res = await fetch(url);
|
|
@@ -28,28 +28,33 @@ async function downloadFile(url, dest) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
async function main() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
|
|
32
|
+
const platform = process.platform;
|
|
33
|
+
let target;
|
|
34
|
+
if (platform === "win32") {
|
|
35
|
+
target = "seyuna-windows.exe";
|
|
36
|
+
} else if (platform === "darwin") {
|
|
37
|
+
target = "seyuna-macos";
|
|
38
|
+
} else if (platform === "linux") {
|
|
39
|
+
target = "seyuna-linux";
|
|
40
|
+
} else {
|
|
41
|
+
console.error(`Unsupported platform: ${platform}`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const releaseUrl = `https://github.com/seyuna-corp/seyuna-cli/releases/download/v${version}/${target}`;
|
|
46
|
+
const dest = path.join(__dirname, "bin", "seyuna");
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
await downloadFile(releaseUrl, dest);
|
|
50
|
+
if (platform !== "win32") {
|
|
51
|
+
await chmod(dest, 0o755);
|
|
50
52
|
}
|
|
53
|
+
console.log(`seyuna CLI v${version} installed to ${dest}`);
|
|
54
|
+
} catch (err) {
|
|
55
|
+
console.error(err);
|
|
56
|
+
process.exit(1);
|
|
51
57
|
}
|
|
52
|
-
console.log("All binaries downloaded and ready.");
|
|
53
58
|
}
|
|
54
59
|
|
|
55
|
-
main();
|
|
60
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seyuna/cli",
|
|
3
|
-
"version": "0.0.2-dev.
|
|
3
|
+
"version": "0.0.2-dev.9",
|
|
4
4
|
"bin": {
|
|
5
5
|
"seyuna": "./bin/seyuna"
|
|
6
6
|
},
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
8
|
+
"postinstall": "node node-install.js"
|
|
9
9
|
},
|
|
10
10
|
"description": "Seyuna CLI",
|
|
11
11
|
"author": "Seyuna",
|
package/bin/seyuna
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { spawn } from "child_process";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { fileURLToPath } from "url";
|
|
5
|
-
import process from "process";
|
|
6
|
-
|
|
7
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
const platform = process.platform;
|
|
9
|
-
let target;
|
|
10
|
-
if (platform === "win32") {
|
|
11
|
-
target = "seyuna-windows.exe";
|
|
12
|
-
} else if (platform === "darwin") {
|
|
13
|
-
target = "seyuna-macos";
|
|
14
|
-
} else if (platform === "linux") {
|
|
15
|
-
target = "seyuna-linux";
|
|
16
|
-
} else {
|
|
17
|
-
console.error(`Unsupported platform: ${platform}`);
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
const binPath = path.join(__dirname, target);
|
|
21
|
-
|
|
22
|
-
const child = spawn(binPath, process.argv.slice(2), {
|
|
23
|
-
stdio: "inherit",
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
child.on("exit", code => process.exit(code));
|
package/bin/seyuna-linux
DELETED
|
Binary file
|
package/bin/seyuna-macos
DELETED
|
Binary file
|
package/bin/seyuna-windows.exe
DELETED
|
Binary file
|
package/deno.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@seyuna/cli",
|
|
3
|
-
"version": "0.0.2-dev.8",
|
|
4
|
-
"description": "Seyuna CLI",
|
|
5
|
-
"bin": {
|
|
6
|
-
"seyuna": "./deno-wrapper.ts"
|
|
7
|
-
},
|
|
8
|
-
"exports": "./deno-wrapper.ts",
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"tasks": {
|
|
11
|
-
"install": "deno run --allow-write --allow-net deno-install.ts"
|
|
12
|
-
}
|
|
13
|
-
}
|