Skip to content

Commit a1a72ce

Browse files
committed
feat: reenable indicatif, since the eaten line was fixed
1 parent 4e5d91e commit a1a72ce

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

cmds/fleet/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ nom = "7.1.3"
4949
fleet-base = { version = "0.1.0", path = "../../crates/fleet-base" }
5050

5151
[features]
52+
default = ["indicatif"]
5253
# Not quite stable
5354
indicatif = [
5455
"dep:tracing-indicatif",

cmds/fleet/src/main.rs

-4
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ fn main() -> ExitCode {
185185
#[tokio::main]
186186
async fn async_main(opts: RootOpts) -> ExitCode {
187187
if let Err(e) = main_real(opts).await {
188-
// If I remove this line, the next error!() line gets eaten.
189-
// This is a bug in indicatif, it needs to be fixed
190-
#[cfg(feature = "indicatif")]
191-
info!("fixme: this line gets eaten by tracing-indicatif on levels info+");
192188
error!("{e:#}");
193189
return ExitCode::FAILURE;
194190
}

crates/fleet-base/src/opts.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{
66
sync::{Arc, Mutex},
77
};
88

9-
use anyhow::Result;
9+
use anyhow::{Context, Result};
1010
use clap::Parser;
1111
use nix_eval::{nix_go, util::assert_warn, NixSessionPool, Value};
1212
use nom::{
@@ -196,7 +196,8 @@ impl FleetOpts {
196196

197197
let mut fleet_data_path = directory.clone();
198198
fleet_data_path.push("fleet.nix");
199-
let bytes = std::fs::read_to_string(fleet_data_path)?;
199+
let bytes =
200+
std::fs::read_to_string(fleet_data_path).context("reading fleet state (fleet.nix)")?;
200201
let data: Mutex<FleetData> = nixlike::parse_str(&bytes)?;
201202

202203
let fleet_root = Value::binding(nix_session.clone(), "fleetConfigurations").await?;

0 commit comments

Comments
 (0)