@seyuna/cli 0.0.2-dev.1 → 0.0.2-dev.3
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 +0 -0
- package/deno-wrapper.ts +3 -11
- package/deno.json +1 -1
- package/node-install.js +1 -8
- package/package.json +1 -1
package/bin/seyuna
CHANGED
|
Binary file
|
package/deno-wrapper.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env -S deno run --allow-run --allow-read --allow-write --allow-net
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { dirname, join } from "jsr:@std/path@^0.224.0";
|
|
4
4
|
import { ensureDir, existsSync } from "jsr:@std/fs@^0.224.0";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
async function getVersion(): Promise<string> {
|
|
8
|
-
const text = await Deno.readTextFile("deno.json");
|
|
9
|
-
const config = JSON.parse(text);
|
|
10
|
-
return config.version;
|
|
11
|
-
}
|
|
6
|
+
const version = "0.0.2-dev.3";
|
|
12
7
|
|
|
13
8
|
// Download a file from a URL to a destination path
|
|
14
9
|
async function downloadFile(url: string, dest: string): Promise<void> {
|
|
@@ -22,17 +17,14 @@ async function downloadFile(url: string, dest: string): Promise<void> {
|
|
|
22
17
|
await res.body.pipeTo(file.writable);
|
|
23
18
|
}
|
|
24
19
|
|
|
25
|
-
// Main execution
|
|
26
20
|
async function main() {
|
|
27
21
|
const platform = Deno.build.os; // "windows", "linux", or "darwin"
|
|
28
22
|
const binName = platform === "windows" ? "seyuna.exe" : "seyuna";
|
|
29
|
-
const binPath = join(
|
|
23
|
+
const binPath = join(scriptDir, "bin", binName);
|
|
30
24
|
|
|
31
25
|
if (!existsSync(binPath)) {
|
|
32
26
|
console.log("seyuna binary not found, downloading...");
|
|
33
27
|
|
|
34
|
-
const version = await getVersion();
|
|
35
|
-
|
|
36
28
|
let target: string;
|
|
37
29
|
switch (platform) {
|
|
38
30
|
case "windows":
|
package/deno.json
CHANGED
package/node-install.js
CHANGED
|
@@ -6,6 +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.3";
|
|
9
10
|
|
|
10
11
|
async function downloadFile(url, dest) {
|
|
11
12
|
const res = await fetch(url);
|
|
@@ -26,15 +27,7 @@ async function downloadFile(url, dest) {
|
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
async function getVersion() {
|
|
30
|
-
const pkgPath = path.join(__dirname, "package.json");
|
|
31
|
-
const pkgJson = await readFile(pkgPath, "utf8");
|
|
32
|
-
return JSON.parse(pkgJson).version;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
30
|
async function main() {
|
|
36
|
-
const version = await getVersion();
|
|
37
|
-
|
|
38
31
|
const platform = process.platform;
|
|
39
32
|
let target;
|
|
40
33
|
if (platform === "win32") {
|