@seyuna/cli 0.0.2-dev.6 → 0.0.2-dev.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/bin/seyuna ADDED
@@ -0,0 +1,26 @@
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 CHANGED
Binary file
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seyuna/cli",
3
- "version": "0.0.2-dev.6",
3
+ "version": "0.0.2-dev.7",
4
4
  "description": "Seyuna CLI",
5
5
  "bin": {
6
6
  "seyuna": "./deno-wrapper.ts"
package/node-install.js CHANGED
@@ -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.6";
9
+ const version = "0.0.2-dev.7";
10
10
 
11
11
  async function downloadFile(url, dest) {
12
12
  const res = await fetch(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seyuna/cli",
3
- "version": "0.0.2-dev.6",
3
+ "version": "0.0.2-dev.7",
4
4
  "bin": {
5
5
  "seyuna": "./bin/seyuna"
6
6
  },
package/deno-wrapper.ts DELETED
@@ -1,45 +0,0 @@
1
- import { fromFileUrl, dirname, join } from "jsr:@std/path@^0.224.0";
2
-
3
- // Get the directory where this script is located
4
- const scriptDir = dirname(fromFileUrl(import.meta.url));
5
-
6
- // Use scriptDir instead of cwd
7
- function getWritableDir(): string {
8
- return join(scriptDir, ".seyuna");
9
- }
10
-
11
- const platform = Deno.build.os;
12
- const binaryName = platform === "windows"
13
- ? "seyuna-windows.exe"
14
- : platform === "darwin"
15
- ? "seyuna-macos"
16
- : "seyuna-linux";
17
-
18
- const version = "0.0.2-dev.6";
19
- const url = `https://github.com/seyuna-corp/seyuna-cli/releases/download/v${version}/${binaryName}`;
20
-
21
- const binDir = getWritableDir();
22
- await Deno.mkdir(binDir, { recursive: true });
23
- const binaryPath = join(binDir, binaryName);
24
-
25
- // Download if missing
26
- try {
27
- await Deno.stat(binaryPath);
28
- } catch {
29
- console.log(`Downloading ${binaryName} from ${url}`);
30
- const res = await fetch(url);
31
- if (!res.ok) throw new Error(`Download failed: ${res.status}`);
32
- const file = await Deno.open(binaryPath, { create: true, write: true });
33
- await res.body?.pipeTo(file.writable);
34
- await Deno.chmod(binaryPath, 0o755); // Required for UNIX
35
- }
36
-
37
- // Execute
38
- const command = new Deno.Command(binaryPath, {
39
- args: Deno.args,
40
- stdin: "inherit",
41
- stdout: "inherit",
42
- stderr: "inherit",
43
- });
44
- const { code } = await command.output();
45
- Deno.exit(code);