Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/cli/src/subcommands/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ pub async fn exec(mut config: Config, args: &ArgMatches) -> Result<(), anyhow::E
let anon_identity = args.get_flag("anon_identity");
let skip_clippy = args.get_flag("skip_clippy");
let build_debug = args.get_flag("debug");
let database_host = config.get_host_url(server)?;

let mut query_params = Vec::<(&str, &str)>::new();
query_params.push(("host_type", host_type.as_str()));
Expand Down Expand Up @@ -138,9 +139,14 @@ pub async fn exec(mut config: Config, args: &ArgMatches) -> Result<(), anyhow::E

let path_to_wasm = crate::tasks::build(path_to_project, skip_clippy, build_debug)?;
let program_bytes = fs::read(path_to_wasm)?;
println!(
"Uploading to {} => {}",
server.unwrap_or(config.default_server_name().unwrap_or("<default>")),
database_host
);

let mut builder = reqwest::Client::new().post(Url::parse_with_params(
format!("{}/database/publish", config.get_host_url(server)?).as_str(),
format!("{}/database/publish", database_host).as_str(),
query_params,
)?);

Expand Down