Skip to content

Commit

Permalink
refactor: use color_eyre
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanccn committed Dec 4, 2023
1 parent 5412ad0 commit c4a32f5
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 10 deletions.
123 changes: 116 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ license = "GPL-3.0-only"
repository = "https://github.com/ryanccn/nrr.git"

[dependencies]
anyhow = "1.0.75"
clap = { version = "4.4.8", features = ["derive"] }
color-eyre = "0.6.2"
nix = { version = "0.27.1", features = ["signal"] }
owo-colors = { version = "3.5.0", features = ["supports-color"] }
serde = { version = "1.0.193", features = ["derive"] }
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use clap::{Parser, ValueEnum};
use owo_colors::OwoColorize;

use anyhow::Result;
use color_eyre::Result;
use std::{env, path::PathBuf};
use tokio::fs;

Expand Down Expand Up @@ -163,6 +163,8 @@ impl Cli {

#[tokio::main]
async fn main() -> Result<()> {
color_eyre::install()?;

let raw_args: Vec<String> = env::args().collect();

let cli = Cli::parse_from(
Expand Down
2 changes: 1 addition & 1 deletion src/run_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use nix::{
};
use which::which;

use anyhow::Result;
use color_eyre::Result;
use owo_colors::OwoColorize;
use std::{
env,
Expand Down

0 comments on commit c4a32f5

Please sign in to comment.