@seyuna/cli 0.0.2-dev.1 → 0.0.2-dev.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/bin/seyuna CHANGED
Binary file
package/deno-wrapper.ts CHANGED
@@ -1,11 +1,14 @@
1
1
  #!/usr/bin/env -S deno run --allow-run --allow-read --allow-write --allow-net
2
2
 
3
- import { join, dirname } from "jsr:@std/path@^0.224.0";
3
+ import { fromFileUrl, dirname, join } from "jsr:@std/path@^0.224.0";
4
4
  import { ensureDir, existsSync } from "jsr:@std/fs@^0.224.0";
5
5
 
6
- // Get version from deno.json
6
+ const scriptDir = dirname(fromFileUrl(import.meta.url));
7
+
8
+ // Get version from deno.json located relative to this script file
7
9
  async function getVersion(): Promise<string> {
8
- const text = await Deno.readTextFile("deno.json");
10
+ const configPath = join(scriptDir, "deno.json");
11
+ const text = await Deno.readTextFile(configPath);
9
12
  const config = JSON.parse(text);
10
13
  return config.version;
11
14
  }
@@ -22,11 +25,10 @@ async function downloadFile(url: string, dest: string): Promise<void> {
22
25
  await res.body.pipeTo(file.writable);
23
26
  }
24
27
 
25
- // Main execution
26
28
  async function main() {
27
29
  const platform = Deno.build.os; // "windows", "linux", or "darwin"
28
30
  const binName = platform === "windows" ? "seyuna.exe" : "seyuna";
29
- const binPath = join(Deno.cwd(), "bin", binName);
31
+ const binPath = join(scriptDir, "bin", binName);
30
32
 
31
33
  if (!existsSync(binPath)) {
32
34
  console.log("seyuna binary not found, downloading...");
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seyuna/cli",
3
- "version": "0.0.2-dev.1",
3
+ "version": "0.0.2-dev.2",
4
4
  "description": "Seyuna CLI",
5
5
  "bin": {
6
6
  "seyuna": "./deno-wrapper.ts"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seyuna/cli",
3
- "version": "0.0.2-dev.1",
3
+ "version": "0.0.2-dev.2",
4
4
  "bin": {
5
5
  "seyuna": "./bin/seyuna"
6
6
  },