Skip to content

Commit

Permalink
Provide command feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
vascocosta committed Apr 6, 2024
1 parent 6814f83 commit 67351d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ fn build() -> Result<(), Box<dyn Error>> {
let config: Config =
toml::from_str(&read_to_string(TOML).map_err(|_| format!("Could not open {}", TOML))?)
.map_err(|_| format!("Syntax error in {}", TOML))?;
println!(
"\tBuilding {} v{}",
&config.package.name, &config.package.version
);
let path = format!("{}/{}", SRC, MAIN);
let f = File::open(&path).map_err(|_| format!("Could not open {}", &path))?;
let mut lines: Vec<String> = Vec::new();
Expand Down Expand Up @@ -97,6 +101,8 @@ fn build() -> Result<(), Box<dyn Error>> {
.map_err(|_| format!("Could not write to {}", &path))?;
}

println!("\tFinished");

Ok(())
}

Expand All @@ -118,6 +124,8 @@ fn new(name: &str) -> Result<(), Box<dyn Error>> {
let mut output = File::create(&path).map_err(|_| format!("Could not create {}", &path))?;
write!(output, "{}", HELLO).map_err(|_| format!("Could not write to {}", &path))?;

println!("\tCreated `{}` package", name);

Ok(())
}

Expand Down

0 comments on commit 67351d3

Please sign in to comment.