diff --git a/Cargo.toml b/Cargo.toml index e8cebe0b63..e16d54c5c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasmcloud" -version = "0.15.2" +version = "0.15.3" authors = ["wasmcloud Team"] edition = "2018" default-run = "wasmcloud" @@ -75,8 +75,4 @@ members = [ [[bin]] name = "wasmcloud" -path = "src/wasmcloud.rs" - -[[bin]] -name = "wasmcloud-lite" -path = "src/wasmcloud-lite.rs" +path = "src/wasmcloud.rs" \ No newline at end of file diff --git a/codegen.yaml b/codegen.yaml deleted file mode 100644 index 2defb6c92c..0000000000 --- a/codegen.yaml +++ /dev/null @@ -1,5 +0,0 @@ -schema: ../schemas/http.widl -generates: - tests/generated/http.rs: - package: widl-codegen/language/rust - visitorClass: ModuleVisitor diff --git a/src/wasmcloud-lite.rs b/src/wasmcloud-lite.rs deleted file mode 100644 index aa2d108eeb..0000000000 --- a/src/wasmcloud-lite.rs +++ /dev/null @@ -1,7 +0,0 @@ -/// A version of the binary host that uses the inproc bus for -/// local testing and development w/out a lattice connection - -fn main() -> anyhow::Result<()> { - println!("TBD"); - Ok(()) -} diff --git a/src/wasmcloud.rs b/src/wasmcloud.rs index 0ba80a7a38..d56c443ced 100644 --- a/src/wasmcloud.rs +++ b/src/wasmcloud.rs @@ -1,7 +1,7 @@ -use std::fs::File; use std::io::prelude::*; +use std::{fs::File, path::PathBuf}; use structopt::{clap::AppSettings, StructOpt}; -use wasmcloud_host::{HostBuilder, Result}; +use wasmcloud_host::{HostBuilder, HostManifest, Result}; #[macro_use] extern crate log; @@ -70,6 +70,10 @@ struct Cli { /// Allows the use of HTTP registry connections to these registries #[structopt(long = "allowed-insecure")] allowed_insecure: Vec, + + /// Specifies a manifest file to apply to the host once started + #[structopt(long = "manifest", short = "m", parse(from_os_str))] + manifest: Option, } #[actix_rt::main] @@ -82,6 +86,13 @@ async fn main() -> Result<()> { .format_module_path(false) .try_init(); + if let Some(ref pb) = cli.manifest { + if !pb.exists() { + error!("Specified manifest file {:?} could not be opened", pb); + return Err("Manifest file could not be opened.".into()); + } + } + let nats_url = &format!("{}:{}", cli.rpc_host, cli.rpc_port); let nc_rpc = nats_connection(nats_url, cli.rpc_jwt, cli.rpc_seed, cli.rpc_credsfile).await?; let nc_control = nats_connection( @@ -112,6 +123,12 @@ async fn main() -> Result<()> { let host = host_builder.build(); match host.start().await { Ok(_) => { + if let Some(pb) = cli.manifest { + if pb.exists() { + let hm = HostManifest::from_path(pb, true)?; + host.apply_manifest(hm).await?; + } + } actix_rt::signal::ctrl_c().await.unwrap(); info!("Ctrl-C received, shutting down"); host.stop().await;