koro-ai 1.1.0 → 1.1.1
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/koro.mjs +3 -7
- package/package.json +1 -1
package/bin/koro.mjs
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { spawn } from "child_process"
|
|
2
|
+
import { spawn, execSync } from "child_process"
|
|
3
3
|
import { fileURLToPath } from "url"
|
|
4
4
|
import path from "path"
|
|
5
|
+
import { existsSync, mkdirSync } from "fs"
|
|
5
6
|
|
|
6
7
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
7
8
|
const koroDir = path.resolve(__dirname, "..", "koro-source")
|
|
8
9
|
const srcIndex = path.join(koroDir, "packages", "opencode", "src", "index.ts")
|
|
9
10
|
|
|
10
|
-
// Check if source exists, if not clone it
|
|
11
|
-
import { existsSync } from "fs"
|
|
12
|
-
import { mkdirSync } from "fs"
|
|
13
|
-
|
|
14
11
|
if (!existsSync(srcIndex)) {
|
|
15
12
|
console.log("Setting up Koro for first use...")
|
|
16
|
-
const { execSync } = await import("child_process")
|
|
17
13
|
mkdirSync(koroDir, { recursive: true })
|
|
18
14
|
try {
|
|
19
|
-
execSync("git clone https://github.com/iluminatibro/koro.git
|
|
15
|
+
execSync("git clone https://github.com/iluminatibro/koro.git " + koroDir, { stdio: "inherit" })
|
|
20
16
|
execSync("bun install", { cwd: koroDir, stdio: "inherit" })
|
|
21
17
|
} catch (e) {
|
|
22
18
|
console.error("Failed to set up Koro. Please install bun: npm i -g bun")
|