@@ -22,7 +22,11 @@ export { CloudApi } from "./api";
2222export * from "./types" ;
2323
2424const packageInfo = require ( "../package" ) ;
25- const SUPPORT_COMMANDS = [ "deploy" , "compile" ] ;
25+ const SUPPORT_COMMANDS = [ "deploy" , "compile" , "run" ] ;
26+
27+ interface CommandParams {
28+ runCommand ?: string
29+ }
2630
2731export async function run (
2832 {
@@ -33,7 +37,8 @@ export async function run(
3337 resourceProviders,
3438 } : CloudbaseFrameworkConfig ,
3539 command : "deploy" = "deploy" ,
36- module ?: string
40+ module ?: string ,
41+ params ?: CommandParams
3742) {
3843 const logger = getLogger ( logLevel ) ;
3944
@@ -113,7 +118,7 @@ export async function run(
113118 await pluginManager . init ( module ) ;
114119 await pluginManager . build ( module ) ;
115120 const compileResult = await pluginManager . compile ( module ) ;
116- await samManager . generate (
121+ samManager . generate (
117122 samMeta ,
118123 JSON . parse ( JSON . stringify ( compileResult ) )
119124 ) ;
@@ -124,10 +129,12 @@ export async function run(
124129 await pluginManager . build ( module ) ;
125130
126131 const compileResult = await pluginManager . compile ( module ) ;
127- await samManager . generate (
132+ samManager . generate (
128133 samMeta ,
129134 JSON . parse ( JSON . stringify ( compileResult ) )
130135 ) ;
136+ } else if ( command === "run" ) {
137+ await pluginManager . run ( module , params ?. runCommand ) ;
131138 }
132139
133140 logger . info ( "✨ done" ) ;
0 commit comments