这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 7 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use data::kv::KV;
use router::Routes;
use std::io::{Error, ErrorKind};
use std::path::PathBuf;
use std::process::exit;
use std::{collections::HashMap, sync::RwLock};
use workers::wasm_io::WasmOutput;

Expand Down Expand Up @@ -225,38 +224,40 @@ async fn main() -> std::io::Result<()> {

// Check the given subcommand
if let Some(Main::Runtimes(sub)) = &args.commands {
let mut run_result = Ok(());

match &sub.runtime_commands {
RuntimesCommands::List(list) => {
if let Err(err) = list.run(sub).await {
println!("❌ There was an error listing the runtimes from the repository");
println!("👉 {err}");
exit(1);
run_result = Err(Error::new(ErrorKind::InvalidData, ""));
}
}
RuntimesCommands::Install(install) => {
if let Err(err) = install.run(&args.path, sub).await {
println!("❌ There was an error installing the runtime from the repository");
println!("👉 {err}");
exit(1);
run_result = Err(Error::new(ErrorKind::InvalidData, ""));
}
}
RuntimesCommands::Uninstall(uninstall) => {
if let Err(err) = uninstall.run(&args.path, sub) {
println!("❌ There was an error uninstalling the runtime");
println!("👉 {err}");
exit(1);
run_result = Err(Error::new(ErrorKind::InvalidData, ""));
}
}
RuntimesCommands::Check(check) => {
if let Err(err) = check.run(&args.path) {
println!("❌ There was an error checking the local runtimes");
println!("👉 {err}");
exit(1);
run_result = Err(Error::new(ErrorKind::InvalidData, ""));
}
}
};

Ok(())
run_result
} else {
// TODO(Angelmmiguel): refactor this into a separate command!
// Initialize the routes
Expand Down
2 changes: 1 addition & 1 deletion src/runtimes/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl Checksum {
pub fn validate(&self, bytes: &[u8]) -> Result<()> {
match self {
Checksum::Sha256 { value } if value == &sha256_digest(bytes) => Ok(()),
_ => Err(anyhow!("The checksums dont not match")),
_ => Err(anyhow!("The checksums don't match")),
}
}
}
Expand Down