@@ -5,6 +5,8 @@ import { handleError } from "@/src/utils/handle-error"
5
5
import { logger } from "@/src/utils/logger"
6
6
import { getAvailableDatabases , getRegistryIndex , listPluginsByType } from "@/src/utils/registry"
7
7
import { createDatabaseTemplate , createPluginsTemplate , createEnvTemplate } from "@/src/utils/templates"
8
+ import { runBunCommand } from "@/src/utils/run-bun"
9
+ import { installPlugin } from "@/src/utils/install-plugin"
8
10
import chalk from "chalk"
9
11
import { Command } from "commander"
10
12
import { execa } from "execa"
@@ -18,7 +20,7 @@ const initOptionsSchema = z.object({
18
20
19
21
async function cloneStarterRepo ( targetDir : string ) {
20
22
logger . info ( "Setting up project structure..." )
21
- await execa ( "git" , [ "clone" , "-b" , process . env . ELIZA_BRANCH ?? "v2-develop" , "https://github.com/elizaos/eliza" , "." ] , {
23
+ await execa ( "git" , [ "clone" , "-b" , process . env . ELIZA_BRANCH || "v2-develop" , "https://github.com/elizaos/eliza" , "." ] , {
22
24
cwd : targetDir ,
23
25
stdio : "inherit" ,
24
26
} )
@@ -74,21 +76,14 @@ async function installDependencies(targetDir: string, database: string, selected
74
76
} )
75
77
76
78
// Use bun for installation
77
- await execa ( "bun" , [ "install" , "--no-frozen-lockfile" ] , {
78
- cwd : targetDir ,
79
- stdio : "inherit"
80
- } )
81
-
82
- await execa ( "bun" , [ "add" , `@elizaos/adapter-${ database } ` , "--workspace-root" ] , {
83
- cwd : targetDir ,
84
- stdio : "inherit"
85
- } )
79
+ await runBunCommand ( [ "install" , "--no-frozen-lockfile" ] , targetDir ) ;
80
+ await runBunCommand ( [ "add" , `@elizaos/adapter-${ database } ` , "--workspace-root" ] , targetDir ) ;
86
81
87
82
if ( selectedPlugins . length > 0 ) {
88
- await execa ( "bun" , [ "add" , ... selectedPlugins , "--workspace-root" ] , {
89
- cwd : targetDir ,
90
- stdio : "inherit"
91
- } )
83
+ console . log ( selectedPlugins )
84
+ for ( const plugin of selectedPlugins ) {
85
+ await installPlugin ( plugin , targetDir )
86
+ }
92
87
}
93
88
}
94
89
0 commit comments