Skip to content

Commit

Permalink
Don't print out Updating registry message with -q. Bump version to 2.2.1
Browse files Browse the repository at this point in the history
Ref: #115
  • Loading branch information
nabijaczleweli committed Oct 15, 2019
1 parent fb39309 commit 26b2309
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ categories = ["development-tools::cargo-plugins"]
license = "MIT"
build = "build.rs"
# Remember to also update in appveyor.yml
version = "2.2.0"
version = "2.2.1"
# Remember to also update in man/*.md
authors = ["nabijaczleweli <[email protected]>",
"Yann Simon <[email protected]>",
Expand Down
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2.2.0-{build}
version: 2.2.1-{build}

skip_tags: false

Expand All @@ -25,17 +25,17 @@ build: off
build_script:
- git submodule update --init --recursive
- cargo build --release
- cp target\release\cargo-install-update.exe cargo-install-update-v2.2.0.exe
- strip --strip-all --remove-section=.comment --remove-section=.note cargo-install-update-v2.2.0.exe
- cp target\release\cargo-install-update.exe cargo-install-update-v2.2.1.exe
- strip --strip-all --remove-section=.comment --remove-section=.note cargo-install-update-v2.2.1.exe

test: off

artifacts:
- path: cargo-install-update-v2.2.0.exe
- path: cargo-install-update-v2.2.1.exe

deploy:
provider: GitHub
artifact: cargo-install-update-v2.2.0.exe
artifact: cargo-install-update-v2.2.1.exe
auth_token:
secure: 8dP4MwLtHqrSNKYKeSGSt8vm/QIc+0LHdSoI2ReFPAWEL9VrU8+88YcjQNcF6Wzn
on:
Expand Down
19 changes: 15 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ extern crate lazysort;
extern crate regex;
extern crate git2;

use std::io::{Write, stdout, sink};
use std::process::{Command, exit};
use std::io::{Write, stdout};
use tabwriter::TabWriter;
use lazysort::SortedBy;
use std::fmt::Display;
Expand Down Expand Up @@ -75,7 +75,14 @@ fn actual_main() -> Result<(), i32> {
eprintln!("Failed to open registry repository at {}.", registry.display());
2
})?;
cargo_update::ops::update_index(&mut registry_repo, &registry_url, http_proxy.as_ref().map(String::as_str), &mut stdout()).map_err(|e| {
cargo_update::ops::update_index(&mut registry_repo,
&registry_url,
http_proxy.as_ref().map(String::as_str),
&mut if !opts.quiet {
Box::new(stdout()) as Box<dyn Write>
} else {
Box::new(sink()) as Box<dyn Write>
}).map_err(|e| {
eprintln!("Failed to update index repository: {}.", e);
2
})?;
Expand Down Expand Up @@ -183,7 +190,9 @@ fn actual_main() -> Result<(), i32> {
}
.unwrap();

println!();
if !opts.quiet {
println!();
}
if !install_res.success() {
if cfg!(target_os = "windows") && package.version.is_some() && package.name == "cargo-update" {
restore_cargo_update_exec(package.version.as_ref().unwrap());
Expand Down Expand Up @@ -307,7 +316,9 @@ fn actual_main() -> Result<(), i32> {
}
.unwrap();

println!();
if !opts.quiet {
println!();
}
if !install_res.success() {
if cfg!(target_os = "windows") && package.name == "cargo-update" {
restore_cargo_update_exec(&package.id.to_string());
Expand Down

0 comments on commit 26b2309

Please sign in to comment.