Bump self-update (#369)
This commit is contained in:
committed by
GitHub
parent
754402cfac
commit
6cddd57850
2169
Cargo.lock
generated
2169
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -21,10 +21,8 @@ structopt = "0.3.0"
|
||||
log = "0.4.6"
|
||||
walkdir = "2.2.7"
|
||||
console = "0.9.0"
|
||||
self_update_crate = { version = "0.8.0", optional = true, package = "self_update" }
|
||||
lazy_static = "1.3.0"
|
||||
chrono = "0.4.6"
|
||||
openssl-probe = { version = "0.1.2", optional = true }
|
||||
pretty_env_logger = "0.4.0"
|
||||
glob = "0.3.0"
|
||||
strum = { version = "0.17.1", features = ["derive"] }
|
||||
@@ -38,6 +36,10 @@ notify-rust = "3.6.3"
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
nix = "0.17.0"
|
||||
self_update_crate = { version = "0.14.0", optional = true, package = "self_update", features = ["archive-tar", "compression-flate2", "rustls"] }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
self_update_crate = { version = "0.14.0", optional = true, package = "self_update", features = ["archive-zip", "compression-zip-deflate", "rustls"] }
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
rust-ini = "0.15.0"
|
||||
@@ -48,4 +50,4 @@ lto = true
|
||||
[features]
|
||||
default = []
|
||||
|
||||
self-update = ["self_update_crate", "openssl-probe"]
|
||||
self-update = ["self_update_crate"]
|
||||
|
||||
@@ -72,7 +72,6 @@ fn run() -> Result<()> {
|
||||
|
||||
#[cfg(feature = "self-update")]
|
||||
{
|
||||
openssl_probe::init_ssl_cert_env_vars();
|
||||
if !run_type.dry() && env::var("TOPGRADE_NO_SELF_UPGRADE").is_err() {
|
||||
let result = self_update::self_update();
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@ use super::terminal::*;
|
||||
#[cfg(windows)]
|
||||
use crate::error::Upgraded;
|
||||
use anyhow::{bail, Result};
|
||||
use self_update_crate::backends::github::{GitHubUpdateStatus, Update};
|
||||
use self_update_crate::backends::github::Update;
|
||||
use self_update_crate::update::UpdateStatus;
|
||||
use std::env;
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::process::CommandExt;
|
||||
@@ -22,12 +23,14 @@ pub fn self_update() -> Result<()> {
|
||||
.show_download_progress(true)
|
||||
.current_version(self_update_crate::cargo_crate_version!())
|
||||
.no_confirm(true)
|
||||
.build()
|
||||
.and_then(Update::update_extended)?;
|
||||
.build()?
|
||||
.update_extended()?;
|
||||
|
||||
if let GitHubUpdateStatus::Updated(release) = &result {
|
||||
println!("\nTopgrade upgraded to {}:\n", release.version());
|
||||
println!("{}", release.body);
|
||||
if let UpdateStatus::Updated(release) = &result {
|
||||
println!("\nTopgrade upgraded to {}:\n", release.version);
|
||||
if let Some(body) = &release.body {
|
||||
println!("{}", body);
|
||||
}
|
||||
} else {
|
||||
println!("Topgrade is up-to-date");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user