Compare commits

..

1 Commits

Author SHA1 Message Date
ea260b6823 chore(deps): update rust crate anyhow to v1.0.97 2025-03-03 05:37:36 +00:00
6 changed files with 12 additions and 97 deletions

74
Cargo.lock generated
View File

@ -17,15 +17,6 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
[[package]]
name = "aho-corasick"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "anstream" name = "anstream"
version = "0.6.18" version = "0.6.18"
@ -526,15 +517,6 @@ version = "0.4.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e"
[[package]]
name = "matchers"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
dependencies = [
"regex-automata 0.1.10",
]
[[package]] [[package]]
name = "md-5" name = "md-5"
version = "0.10.6" version = "0.10.6"
@ -576,9 +558,9 @@ dependencies = [
[[package]] [[package]]
name = "minijinja" name = "minijinja"
version = "2.8.0" version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" checksum = "cff7b8df5e85e30b87c2b0b3f58ba3a87b68e133738bf512a7713769326dbca9"
dependencies = [ dependencies = [
"serde", "serde",
] ]
@ -791,50 +773,6 @@ dependencies = [
"bitflags", "bitflags",
] ]
[[package]]
name = "regex"
version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata 0.4.9",
"regex-syntax 0.8.5",
]
[[package]]
name = "regex-automata"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
dependencies = [
"regex-syntax 0.6.29",
]
[[package]]
name = "regex-automata"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax 0.8.5",
]
[[package]]
name = "regex-syntax"
version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "regex-syntax"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.24" version = "0.1.24"
@ -903,9 +841,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.140" version = "1.0.139"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6"
dependencies = [ dependencies = [
"itoa", "itoa",
"memchr", "memchr",
@ -1148,14 +1086,10 @@ version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
dependencies = [ dependencies = [
"matchers",
"nu-ansi-term", "nu-ansi-term",
"once_cell",
"regex",
"sharded-slab", "sharded-slab",
"smallvec", "smallvec",
"thread_local", "thread_local",
"tracing",
"tracing-core", "tracing-core",
"tracing-log", "tracing-log",
] ]

View File

@ -7,7 +7,7 @@ resolver = "2"
anyhow = { version = "1" } anyhow = { version = "1" }
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
tracing = { version = "0.1", features = ["log"] } tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } tracing-subscriber = { version = "0.3.18" }
clap = { version = "4", features = ["derive", "env", "cargo", "string"] } clap = { version = "4", features = ["derive", "env", "cargo", "string"] }
dotenvy = { version = "0.15" } dotenvy = { version = "0.15" }
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }

View File

@ -19,7 +19,6 @@ enum Commands {
Init {}, Init {},
Template(template::Template), Template(template::Template),
Info {}, Info {},
Clean {},
Serve { Serve {
#[arg(env = "FOREST_HOST", long, default_value = "127.0.0.1:3000")] #[arg(env = "FOREST_HOST", long, default_value = "127.0.0.1:3000")]
host: SocketAddr, host: SocketAddr,
@ -55,7 +54,9 @@ fn get_root(include_run: bool) -> clap::Command {
); );
if include_run { if include_run {
root_cmd = root_cmd.subcommand(clap::Command::new("run").allow_external_subcommands(true)); root_cmd = root_cmd
.subcommand(clap::Command::new("run").allow_external_subcommands(true))
.ignore_errors(true);
} }
Commands::augment_subcommands(root_cmd) Commands::augment_subcommands(root_cmd)
@ -111,10 +112,7 @@ pub async fn execute() -> anyhow::Result<()> {
matches matches
}; };
match matches match matches.subcommand().unwrap() {
.subcommand()
.expect("forest requires a command to be passed")
{
("run", args) => { ("run", args) => {
run::Run::execute(args, &project_path, &context).await?; run::Run::execute(args, &project_path, &context).await?;
} }
@ -150,13 +148,6 @@ pub async fn execute() -> anyhow::Result<()> {
let _url = put_object.sign(std::time::Duration::from_secs(30)); let _url = put_object.sign(std::time::Duration::from_secs(30));
let _state = SharedState::new().await?; let _state = SharedState::new().await?;
} }
Commands::Clean {} => {
let forest_path = project_path.join(".forest");
if forest_path.exists() {
tokio::fs::remove_dir_all(forest_path).await?;
tracing::info!("removed .forest");
}
}
}, },
} }

View File

@ -71,6 +71,6 @@ impl Run {
} }
} }
anyhow::bail!("no scripts were found for command: {}", name) Ok(())
} }
} }

View File

@ -1,6 +1,3 @@
use tracing::level_filters::LevelFilter;
use tracing_subscriber::EnvFilter;
pub mod cli; pub mod cli;
pub mod model; pub mod model;
pub mod plan_reconciler; pub mod plan_reconciler;
@ -10,14 +7,7 @@ pub mod state;
#[tokio::main] #[tokio::main]
async fn main() -> anyhow::Result<()> { async fn main() -> anyhow::Result<()> {
dotenvy::dotenv().ok(); dotenvy::dotenv().ok();
tracing_subscriber::fmt() tracing_subscriber::fmt::init();
.with_env_filter(
EnvFilter::builder()
.with_default_directive(LevelFilter::WARN.into())
.with_env_var("FOREST_LOG_LEVEL")
.from_env()?,
)
.init();
cli::execute().await?; cli::execute().await?;

View File

@ -26,7 +26,7 @@ impl ScriptExecutor {
return Ok(()); return Ok(());
} }
anyhow::bail!("script was not found for name: {}", name) Ok(())
} }
async fn run_project(&self, script_ctx: &Script, name: &str) -> anyhow::Result<bool> { async fn run_project(&self, script_ctx: &Script, name: &str) -> anyhow::Result<bool> {