Skip to content

Commit

Permalink
parallel updates (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
bend-n authored Feb 27, 2023
1 parent 538ef4b commit 1d5af9d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "godot-package-manager"
version = "1.1.1"
version = "1.1.2"
edition = "2021"
authors = ["bendn <[email protected]>"]
description = "A package manager for godot"
Expand All @@ -26,6 +26,7 @@ console = "0.15.4"
indicatif = "0.17.2"
anyhow = "1.0.68"
dialoguer = { version = "0.10.3", features = [] }
rayon = "1.6"

[dev-dependencies]
glob = "0.3.0"
Expand Down
15 changes: 15 additions & 0 deletions godot.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[
{
"name": "@bendn/splitter",
"version": "1.0.6",
"integrity": "sha512-HT7q5qv6OEpX95e5r+kAsasoAvH0Mgf+aT4SdKQ18fyDIn1dW02WqbulF0AMwHufgRZkMf9SnQGiAq79P5ZIKQ=="
},
{
"name": "@bendn/test",
"version": "2.0.10",
Expand All @@ -8,5 +13,15 @@
"name": "@bendn/gdcli",
"version": "1.2.5",
"integrity": "sha512-/YOAd1+K4JlKvPTmpX8B7VWxGtFrxKq4R0A6u5qOaaVPK6uGsl4dGZaIHpxuqcurEcwPEOabkoShXKZaOXB0lw=="
},
{
"name": "prettier",
"version": "2.8.4",
"integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw=="
},
{
"name": "stockfish",
"version": "15.0.0",
"integrity": "sha512-ze3vTgMrnCmMdtC8qpONBdXkSHWwv4Dx+GFV1V5TIi0qP1HF+Vwa4lArgqvHDooU8Mwfs1cgRzkW3SM8x/7TJg=="
}
]
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::fs::{create_dir, read_dir, read_to_string, remove_dir, write};
use std::io::{stdin, Read};
use std::path::{Path, PathBuf};
use std::{env::current_dir, panic, time::Instant};
use rayon::prelude::*;

#[derive(Parser)]
#[command(name = "gpm")]
Expand Down Expand Up @@ -194,8 +195,7 @@ fn update(cfg: &mut ConfigFile, modify: bool, not_verbose: bool) {
};
let now = Instant::now();
packages
.into_iter()
.progress_with(bar.clone())
.into_par_iter()
.for_each(|mut p| {
bar.set_message(format!("{p}"));
p.download();
Expand All @@ -209,6 +209,7 @@ fn update(cfg: &mut ConfigFile, modify: bool, not_verbose: bool) {
});
}
}
bar.inc(1);
bar.suspend(|| println!("{:>12} {p}", putils::green("Downloaded")));
});
println!(
Expand Down

0 comments on commit 1d5af9d

Please sign in to comment.