Skip to content

Commit 06ff01c

Browse files
committed
Fix bug where --quiet flag is ignored during a git pull
1 parent 2d4ca29 commit 06ff01c

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [0.9.1] - 2024-06-24
4+
5+
### Fixed
6+
7+
- Fix bug where `--quiet` flag was ignored during a `git pull`
8+
39
## [0.9.0] - 2024-06-23
410

511
### Added

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tinted-builder-rust/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tinted-builder-rust"
3-
version = "0.9.0"
3+
version = "0.9.1"
44
edition = "2021"
55
authors = ["Jamy Golden <[email protected]>", "Tinted Theming <[email protected]>"]
66
license = "MIT OR Apache-2.0"

tinted-builder-rust/src/operations/sync.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,23 @@ fn git_clone(repo_url: &str, target_dir: &Path, is_quiet: bool) -> Result<()> {
3030
Ok(())
3131
}
3232

33-
fn git_pull(repo_path: &Path) -> Result<()> {
33+
fn git_pull(repo_path: &Path, is_quiet: bool) -> Result<()> {
3434
if !repo_path.is_dir() {
3535
return Err(anyhow!(
3636
"Error with git pull. {} is not a directory",
3737
repo_path.display()
3838
));
3939
}
4040

41-
let status = Command::new("git")
42-
.arg("pull")
43-
.current_dir(repo_path)
44-
.stdout(Stdio::null())
41+
let mut cmd = Command::new("git");
42+
43+
cmd.arg("pull").current_dir(repo_path);
44+
45+
if is_quiet {
46+
cmd.stdout(Stdio::null()).stderr(Stdio::null());
47+
}
48+
49+
let status = cmd
4550
.status()
4651
.with_context(|| format!("Failed to execute process in {}", repo_path.display()))?;
4752

@@ -74,7 +79,7 @@ pub(crate) fn sync(schemes_path: &Path, is_quiet: bool) -> Result<()> {
7479
let is_diff = git_diff(schemes_path)?;
7580

7681
if !is_diff {
77-
git_pull(schemes_path).with_context(|| {
82+
git_pull(schemes_path, is_quiet).with_context(|| {
7883
format!("Error pulling {} from {}", SCHEMES_REPO_NAME, SCHEMES_URL)
7984
})?;
8085

0 commit comments

Comments
 (0)