Skip to content

Commit

Permalink
new config variable
Browse files Browse the repository at this point in the history
  • Loading branch information
DemwE committed Jul 16, 2023
1 parent 480c238 commit 360f33a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rget"
version = "1.4.0"
version = "1.4.1"
authors = ["Mateusz Czarnecki (DemwE)"]
description = "A simple CLI tool for downloading files from the internet."
edition = "2021"
Expand Down
4 changes: 3 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ pub fn main() -> Value {
let config_dir = BaseDirs::new().unwrap().config_dir().to_str().unwrap().to_string();
let config_file_path = format!("{}/rget/config.toml", config_dir);

let default_config = "progress_bar_chars = '#>-'";
let default_config = "\
progress_bar_chars = '#>-'\n\
progress_bar_style = '[{elapsed_precise}] [{bar:40.cyan/blue}] {bytes}/{total_bytes} | {binary_bytes_per_sec} | eta {eta} '";

// Create config file if it doesn't exist
let config_file = std::fs::File::open(&*config_file_path);
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

// Create progress bar
let pb = ProgressBar::new(total_size);
pb.set_style(ProgressStyle::with_template("[{elapsed_precise}] [{bar:40.cyan/blue}] {bytes}/{total_bytes} | {binary_bytes_per_sec} | eta {eta} ")
pb.set_style(ProgressStyle::with_template(conf["progress_bar_style"].as_str().unwrap())
.unwrap()
.progress_chars(conf["progress_bar_chars"].as_str().unwrap()));

Expand Down

0 comments on commit 360f33a

Please sign in to comment.