Skip to content

Commit b4fa6a3

Browse files
committed
fix(cli): run the server on the appropriate command
1 parent 9aeecda commit b4fa6a3

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dev-tools/*.vsix
2424
typegate/workers
2525
typegate/codegen
2626
typegate/tests/prisma-migrations
27+
typegate/tests/e2e/cli/prisma-migrations
2728
typegate/tests/importers/copy/
2829
.env
2930
typegate/native/bindings.json

meta-cli/src/main.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,7 @@ fn main() -> Result<()> {
6262
Some(cli::Commands::Typegate(cmd_args)) => cli::typegate::command(cmd_args, args.gen)?,
6363
Some(command) => actix::run(async move {
6464
match command {
65-
cli::Commands::Codegen(_) => {
66-
eprintln!("codegen command is disabled for now");
67-
std::process::exit(0)
68-
}
69-
cli::Commands::Undeploy(_) | cli::Commands::Typegate(_) => {
70-
command.run(args.gen).await.unwrap_or_else(|e| {
71-
error!("{}", e.to_string());
72-
std::process::exit(1);
73-
});
74-
}
75-
_ => {
65+
cli::Commands::Serialize(_) | cli::Commands::Dev(_) | cli::Commands::Deploy(_) => {
7666
std::env::set_var("META_CLI_SERVER_PORT", get_instance_port().to_string());
7767

7868
let command = command.run(args.gen);
@@ -82,6 +72,16 @@ fn main() -> Result<()> {
8272
std::process::exit(1);
8373
});
8474
}
75+
cli::Commands::Codegen(_) => {
76+
eprintln!("codegen command is disabled for now");
77+
std::process::exit(0)
78+
}
79+
_ => {
80+
command.run(args.gen).await.unwrap_or_else(|e| {
81+
error!("{}", e.to_string());
82+
std::process::exit(1);
83+
});
84+
}
8585
}
8686
})?,
8787
None => Args::command().print_help()?,

0 commit comments

Comments
 (0)